Skip to content

Commit

Permalink
Disable default project creation in VCA mode
Browse files Browse the repository at this point in the history
Projects should not be managed via Admiral in VCA mode.

Change-Id: I6699affbc7fdf4ca3c7218006c919403164af477
Reviewed-on: https://bellevue-ci.eng.vmware.com:8080/47387
Upgrade-Verified: jenkins <[email protected]>
Closures-Verified: jenkins <[email protected]>
CS-Verified: jenkins <[email protected]>
Bellevue-Verified: jenkins <[email protected]>
PG-Verified: jenkins <[email protected]>
Reviewed-by: Sergio Sanchez <[email protected]>
  • Loading branch information
shadjiiski committed Oct 24, 2018
1 parent 3076ac2 commit 2927dd8
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 VMware, Inc. All Rights Reserved.
* Copyright (c) 2017-2018 VMware, Inc. All Rights Reserved.
*
* This product is licensed to you under the Apache License, Version 2.0 (the "License").
* You may not use this product except in compliance with the License.
Expand All @@ -25,6 +25,7 @@

import com.vmware.admiral.auth.project.ProjectService;
import com.vmware.admiral.common.ManagementUriParts;
import com.vmware.admiral.common.util.ConfigurationUtil;
import com.vmware.admiral.service.common.AbstractInitialBootService;
import com.vmware.xenon.common.Operation;

Expand All @@ -36,18 +37,24 @@ public class AuthInitialBootService extends AbstractInitialBootService {

@Override
public void handlePost(Operation post) {
if (ConfigurationUtil.isVca()) {
logInfo("VCA mode, skipping creation of default user/resource groups and roles.");
post.complete();
return;
}

logInfo("Creating default user/resource groups and roles.");
initInstances(post,
ProjectService.buildDefaultProjectInstance(),
//Initialize Cloud Admins global role.
// Initialize Cloud Admins global role.
buildCloudAdminsUserGroup(),
buildCloudAdminsResourceGroup(),
buildCloudAdminsRole(DEFAULT_IDENTIFIER, CLOUD_ADMINS_USER_GROUP_LINK),
//Initialize Basic Users global role.
// Initialize Basic Users global role.
buildBasicUsersUserGroup(),
buildBasicUsersResourceGroup(),
buildBasicUsersRole(DEFAULT_IDENTIFIER, BASIC_USERS_USER_GROUP_LINK),
//Initialize Basic Users Extended role.
// Initialize Basic Users Extended role.
buildBasicUsersExtendedResourceGroup(),
buildBasicUsersExtendedRole(DEFAULT_IDENTIFIER, BASIC_USERS_USER_GROUP_LINK));
}
Expand Down

0 comments on commit 2927dd8

Please sign in to comment.