Skip to content

Commit 0a24827

Browse files
Aneri ThakkarAneri Thakkar
authored andcommitted
Merge branch 'stable' into upgrade-fix
2 parents 14fd9f0 + 67c9a3e commit 0a24827

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

.github/workflows/python-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
cat ${GITHUB_WORKSPACE}/src/mas/devops/__init__.py
4646
python -m pip install --upgrade pip
4747
pip install .[dev]
48-
python -m pytest
48+
python -m pytest -m "not openshift"
4949
5050
# 3. Flake8 Linting
5151
# -------------------------------------------------------------------------------------------

src/mas/devops/pre_install.py

Lines changed: 14 additions & 13 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,10 +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 []
143-
144135
selectedOperatorDirs = _get_selected_operator_dirs(selectedApps)
145136

146137
sourceRoots = [
@@ -280,12 +271,22 @@ def applyPreInstallMASRBAC(
280271
if not rbacRootDir:
281272
rbacRootDir = DEFAULT_PREINSTALL_MAS_RBAC_ROOT
282273

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

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

0 commit comments

Comments
 (0)