}
}
if (!roleDefs.isEmpty()) {
List<ApiRole> newRoles = new ArrayList<>();
for (CmRoleDef roleDef : roleDefs) {
ApiRole apiRole = createApiRole(roleDef);
newRoles.add(apiRole);
}
String action = "Configuring service " + apiService.getDisplayName();
cluster.getCurrentReport().setNodesAction(action, addedNodeNames);
reportQueue.addClusterReport(cluster.getCurrentReport().clone());
logger.debug("Creating roles " + newRoles);
ApiRoleList roleList =
apiResourceRootV6.getClustersResource()
.getServicesResource(cluster.getName())
.getRolesResource(apiService.getName())
.createRoles(new ApiRoleList(newRoles));
result.get(apiService.getName()).addAll(roleList.getRoles());
}
}
logger.info("Finished configure services");
syncRolesId(cluster);
preDeployConfig(cluster);
// deploy client config for new added roles only
for (String serviceName : result.keySet()) {
final ApiRoleNameList roleNameList = new ApiRoleNameList();
final String sName = serviceName;
List<String> roleNames = new ArrayList<>();
for (ApiRole apiRole : result.get(serviceName)) {
roleNames.add(apiRole.getName());
}
roleNameList.setRoleNames(roleNames);
retry(5, new Retriable() {
@Override
public void doWork() throws Exception {