Skip to content

Commit ed801a9

Browse files
Dixit SathwaraDixit Sathwara
authored andcommitted
[patch] remove the preinstall rbac for minimal
1 parent 184bf9b commit ed801a9

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

src/mas/devops/pre_install.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ def _should_apply_preinstall_mas_rbac_file(fileName: str, permissionMode: str) -
7575
if not (lowerName.endswith(".yml") or lowerName.endswith(".yaml")):
7676
return False
7777

78-
# TODO: Sort out this openshift-ingress exception properly.
79-
# For now, always apply this manifest in any permission mode.
80-
if lowerName == "role-essential-core-entitymgr-suite-openshift-ingress.yaml":
81-
return True
82-
8378
if permissionMode == "cluster":
8479
return lowerName.startswith("cluster-role-")
8580

@@ -137,9 +132,6 @@ def _discover_preinstall_mas_rbac_files(
137132
if not rbacRootDir:
138133
rbacRootDir = DEFAULT_PREINSTALL_MAS_RBAC_ROOT
139134

140-
# Due to ingresscontroller role we need to apply the preinstall RBAC for the minimal permission mode
141-
# if permissionMode == "minimal":
142-
# return []
143135

144136
selectedOperatorDirs = _get_selected_operator_dirs(selectedApps)
145137

@@ -280,12 +272,22 @@ def applyPreInstallMASRBAC(
280272
if not rbacRootDir:
281273
rbacRootDir = DEFAULT_PREINSTALL_MAS_RBAC_ROOT
282274

283-
validatedApps = _validate_selected_apps(selectedApps)
284-
285-
if not validatedApps:
286-
logger.info("No selected apps provided for pre-install MAS RBAC apply")
275+
# Minimal mode - essential roles will be applied by each operator
276+
if permissionMode == "minimal":
277+
logger.info("Minimal permission mode - essential roles will be applied by each operator")
287278
return
288279

280+
# For cluster mode, use ibm-mas operator only (apps not required)
281+
if permissionMode == "cluster":
282+
validatedApps = {"core"} # Use core which maps to ibm-mas operator
283+
logger.info("Cluster permission mode - using ibm-mas operator only")
284+
else:
285+
# For namespaced mode, validate and use selected apps
286+
validatedApps = _validate_selected_apps(selectedApps)
287+
if not validatedApps:
288+
logger.info("No selected apps provided for namespaced mode pre-install MAS RBAC apply")
289+
return
290+
289291
manifestFiles = _discover_preinstall_mas_rbac_files(
290292
rbacRootDir=rbacRootDir,
291293
masVersion=masVersion,

0 commit comments

Comments
 (0)