Skip to content

Commit

Permalink
[patch] Restore support for --skip-grafana-install (#1161)
Browse files Browse the repository at this point in the history
  • Loading branch information
HariPalleti authored and andrefgj committed Aug 12, 2024
1 parent 11d037a commit 3e6bbcc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/commands/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ usage: mas install [-c MAS_CATALOG_VERSION] [--ibm-entitlement-key IBM_ENTITLEME
[--artifactory-username ARTIFACTORY_USERNAME] [--artifactory-token ARTIFACTORY_TOKEN] [--approval-core APPROVAL_CORE]
[--approval-assist APPROVAL_ASSIST] [--approval-iot APPROVAL_IOT] [--approval-manage APPROVAL_MANAGE] [--approval-monitor APPROVAL_MONITOR]
[--approval-optimizer APPROVAL_OPTIMIZER] [--approval-predict APPROVAL_PREDICT] [--approval-visualinspection APPROVAL_VISUALINSPECTION]
[--accept-license] [--dev-mode] [--no-wait-for-pvc] [--skip-pre-check] [--no-confirm] [-h]
[--accept-license] [--dev-mode] [--no-wait-for-pvc] [--skip-pre-check] [--skip-grafana-install] [--no-confirm] [-h]
IBM Maximo Application Suite Admin CLI v100.0.0
Install MAS by configuring and launching the MAS Uninstall Tekton Pipeline.
Expand Down Expand Up @@ -247,6 +247,7 @@ More:
--dev-mode Configure installation for development mode
--no-wait-for-pvc Disable the wait for pipeline PVC to bind before starting the pipeline
--skip-pre-check Disable the 'pre-install-check' at the start of the install pipeline
--skip-grafana-install Skips Grafana install action
--no-confirm Launch the upgrade without prompting for confirmation
-h, --help Show this help message and exit
```
Expand Down
9 changes: 7 additions & 2 deletions python/src/mas/cli/install/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ def configGrafana(self) -> None:
try:
packagemanifestAPI = self.dynamicClient.resources.get(api_version="packages.operators.coreos.com/v1", kind="PackageManifest")
packagemanifestAPI.get(name="grafana-operator", namespace="openshift-marketplace")
self.setParam("grafana_action", "install")
if self.skipGrafanaInstall:
self.setParam("grafana_action", "none")
else:
self.setParam("grafana_action", "install")
except NotFoundError:
self.setParam("grafana_action", "none")

Expand Down Expand Up @@ -842,7 +845,7 @@ def nonInteractiveMode(self) -> None:
self.fatalError(f"Unsupported format for {key} ({value}). Expected string:int:int:boolean")

# Arguments that we don't need to do anything with
elif key in ["accept_license", "dev_mode", "skip_pre_check", "no_confirm", "no_wait_for_pvc", "help"]:
elif key in ["accept_license", "dev_mode", "skip_pre_check", "skip_grafana_install", "no_confirm", "no_wait_for_pvc", "help"]:
pass

elif key == "manual_certificates":
Expand Down Expand Up @@ -886,6 +889,8 @@ def install(self, argv):
# These flags work for setting params in both interactive and non-interactive modes
if args.skip_pre_check:
self.setParam("skip_pre_check", "true")
if args.skip_grafana_install:
self.skipGrafanaInstall = True

self.installOptions = [
{
Expand Down
6 changes: 6 additions & 0 deletions python/src/mas/cli/install/argParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,12 @@ def isValidFile(parser, arg) -> str:
action="store_true",
help="Disable the 'pre-install-check' at the start of the install pipeline"
)
otherArgGroup.add_argument(
"--skip-grafana-install",
required=False,
action="store_true",
help="Skips Grafana install action"
)
otherArgGroup.add_argument(
"--no-confirm",
required=False,
Expand Down
1 change: 1 addition & 0 deletions python/src/mas/cli/install/summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def ocpSummary(self) -> None:
self.printSummary("Single Node OpenShift", "No")

self.printSummary("Skip Pre-Install Healthcheck", "Yes" if self.getParam('skip_pre_check') == "true" else "No")
self.printSummary("Skip Grafana-Install", "Yes" if self.getParam('grafana_action') == "none" else "No")

def icrSummary(self) -> None:
self.printH2("IBM Container Registry Credentials")
Expand Down

0 comments on commit 3e6bbcc

Please sign in to comment.