Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed overwrite JSON type configuration being empty #4486

Merged
merged 14 commits into from
Jul 30, 2022
Prev Previous commit
Next Next commit
feat: 后端支持多namespace
falser101 authored and nobodyiam committed Jul 3, 2022
commit bf0e0872ddc4d17f83fbcccdd8b5617bfb831fc1
Original file line number Diff line number Diff line change
@@ -143,14 +143,12 @@ public ResponseEntity<Void> createNamespace(@PathVariable String appId,
@RequestBody List<NamespaceCreationModel> models) {

checkModel(!CollectionUtils.isEmpty(models));

String namespaceName = models.get(0).getNamespace().getNamespaceName();
String operator = userInfoHolder.getUser().getUserId();

roleInitializationService.initNamespaceRoles(appId, namespaceName, operator);
roleInitializationService.initNamespaceEnvRoles(appId, namespaceName, operator);

for (NamespaceCreationModel model : models) {
String namespaceName = model.getNamespace().getNamespaceName();
roleInitializationService.initNamespaceRoles(appId, namespaceName, operator);
roleInitializationService.initNamespaceEnvRoles(appId, namespaceName, operator);
NamespaceDTO namespace = model.getNamespace();
RequestPrecondition.checkArgumentsNotEmpty(model.getEnv(), namespace.getAppId(),
namespace.getClusterName(), namespace.getNamespaceName());
@@ -163,10 +161,9 @@ public ResponseEntity<Void> createNamespace(@PathVariable String appId,
String.format("create namespace fail. (env=%s namespace=%s)", model.getEnv(),
namespace.getNamespaceName()), e);
}
namespaceService.assignNamespaceRoleToOperator(appId, namespaceName,userInfoHolder.getUser().getUserId());
}

namespaceService.assignNamespaceRoleToOperator(appId, namespaceName,userInfoHolder.getUser().getUserId());

return ResponseEntity.ok().build();
}