2018-05-11 12:47:21 +00:00
|
|
|
export default function(type, count, obj) {
|
|
|
|
var key = '';
|
2018-10-19 15:17:02 +00:00
|
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
2018-05-11 12:47:21 +00:00
|
|
|
switch (type) {
|
|
|
|
case 'dc':
|
|
|
|
key = 'CONSUL_DATACENTER_COUNT';
|
|
|
|
break;
|
|
|
|
case 'service':
|
|
|
|
key = 'CONSUL_SERVICE_COUNT';
|
|
|
|
break;
|
|
|
|
case 'node':
|
|
|
|
key = 'CONSUL_NODE_COUNT';
|
|
|
|
break;
|
|
|
|
case 'kv':
|
|
|
|
key = 'CONSUL_KV_COUNT';
|
|
|
|
break;
|
|
|
|
case 'acl':
|
|
|
|
key = 'CONSUL_ACL_COUNT';
|
2018-10-19 15:17:02 +00:00
|
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
2018-05-11 12:47:21 +00:00
|
|
|
break;
|
2018-06-19 14:25:56 +00:00
|
|
|
case 'session':
|
|
|
|
key = 'CONSUL_SESSION_COUNT';
|
|
|
|
break;
|
2018-06-15 11:47:12 +00:00
|
|
|
case 'intention':
|
|
|
|
key = 'CONSUL_INTENTION_COUNT';
|
|
|
|
break;
|
2018-10-19 15:17:02 +00:00
|
|
|
case 'policy':
|
|
|
|
key = 'CONSUL_POLICY_COUNT';
|
|
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
|
|
|
break;
|
|
|
|
case 'token':
|
|
|
|
key = 'CONSUL_TOKEN_COUNT';
|
|
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
|
|
|
break;
|
2018-05-11 12:47:21 +00:00
|
|
|
}
|
|
|
|
if (key) {
|
|
|
|
obj[key] = count;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
}
|