mas-cli 11.4.0__py3-none-any.whl → 11.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mas-cli might be problematic. Click here for more details.
- mas/cli/__init__.py +1 -1
- mas/cli/cli.py +5 -7
- mas/cli/displayMixins.py +18 -14
- mas/cli/gencfg.py +3 -2
- mas/cli/install/__init__.py +1 -1
- mas/cli/install/app.py +30 -30
- mas/cli/install/argBuilder.py +159 -158
- mas/cli/install/argParser.py +3 -1
- mas/cli/install/settings/__init__.py +5 -4
- mas/cli/install/settings/additionalConfigs.py +25 -24
- mas/cli/install/settings/db2Settings.py +2 -2
- mas/cli/install/settings/kafkaSettings.py +1 -0
- mas/cli/install/settings/manageSettings.py +38 -19
- mas/cli/install/settings/turbonomicSettings.py +1 -0
- mas/cli/install/summarizer.py +6 -6
- mas/cli/templates/ibm-mas-tekton.yaml +587 -150
- mas/cli/uninstall/__init__.py +1 -1
- mas/cli/uninstall/app.py +15 -14
- mas/cli/uninstall/argParser.py +1 -1
- mas/cli/update/__init__.py +1 -1
- mas/cli/update/app.py +39 -39
- mas/cli/update/argParser.py +1 -1
- mas/cli/upgrade/__init__.py +1 -1
- mas/cli/upgrade/app.py +8 -7
- mas/cli/upgrade/argParser.py +1 -1
- {mas_cli-11.4.0.data → mas_cli-11.5.0.data}/scripts/mas-cli +8 -6
- {mas_cli-11.4.0.dist-info → mas_cli-11.5.0.dist-info}/METADATA +1 -1
- {mas_cli-11.4.0.dist-info → mas_cli-11.5.0.dist-info}/RECORD +30 -30
- {mas_cli-11.4.0.dist-info → mas_cli-11.5.0.dist-info}/WHEEL +1 -1
- {mas_cli-11.4.0.dist-info → mas_cli-11.5.0.dist-info}/top_level.txt +0 -0
mas/cli/uninstall/__init__.py
CHANGED
mas/cli/uninstall/app.py
CHANGED
|
@@ -28,6 +28,7 @@ from mas.devops.tekton import installOpenShiftPipelines, updateTektonDefinitions
|
|
|
28
28
|
|
|
29
29
|
logger = logging.getLogger(__name__)
|
|
30
30
|
|
|
31
|
+
|
|
31
32
|
class UninstallApp(BaseApp):
|
|
32
33
|
def uninstall(self, argv):
|
|
33
34
|
"""
|
|
@@ -76,7 +77,7 @@ class UninstallApp(BaseApp):
|
|
|
76
77
|
for suite in suites:
|
|
77
78
|
self.printDescription([f"- <u>{suite['metadata']['name']}</u> v{suite['status']['versions']['reconciled']}"])
|
|
78
79
|
suiteOptions.append(suite['metadata']['name'])
|
|
79
|
-
except ResourceNotFoundError
|
|
80
|
+
except ResourceNotFoundError:
|
|
80
81
|
self.fatalError("No MAS instances were detected on the cluster (Suite.core.mas.ibm.com/v1 API is not available). See log file for details")
|
|
81
82
|
|
|
82
83
|
if len(suiteOptions) == 0:
|
|
@@ -127,7 +128,7 @@ class UninstallApp(BaseApp):
|
|
|
127
128
|
self.fatalError(f"MAS Instance {instanceId} not found on this cluster</Red>")
|
|
128
129
|
|
|
129
130
|
# Default to Red Hat Cert-Manager, and check if IBM cert-manager is installed
|
|
130
|
-
certManagerProvider="redhat"
|
|
131
|
+
certManagerProvider = "redhat"
|
|
131
132
|
try:
|
|
132
133
|
# Check if 'ibm-common-services' namespace exist, this will throw NotFoundError exception when not found.
|
|
133
134
|
namespaceAPI = self.dynamicClient.resources.get(api_version="v1", kind="Namespace")
|
|
@@ -164,7 +165,7 @@ class UninstallApp(BaseApp):
|
|
|
164
165
|
|
|
165
166
|
with Halo(text='Validating OpenShift Pipelines installation', spinner=self.spinner) as h:
|
|
166
167
|
installOpenShiftPipelines(self.dynamicClient)
|
|
167
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
168
|
+
h.stop_and_persist(symbol=self.successIcon, text="OpenShift Pipelines Operator is installed and ready to use")
|
|
168
169
|
|
|
169
170
|
with Halo(text=f'Preparing namespace ({pipelinesNamespace})', spinner=self.spinner) as h:
|
|
170
171
|
createNamespace(self.dynamicClient, pipelinesNamespace)
|
|
@@ -176,17 +177,17 @@ class UninstallApp(BaseApp):
|
|
|
176
177
|
|
|
177
178
|
with Halo(text=f'Submitting PipelineRun for {instanceId} uninstall', spinner=self.spinner) as h:
|
|
178
179
|
pipelineURL = launchUninstallPipeline(
|
|
179
|
-
dynClient
|
|
180
|
-
instanceId
|
|
181
|
-
certManagerProvider
|
|
182
|
-
uninstallCertManager
|
|
183
|
-
uninstallGrafana
|
|
184
|
-
uninstallCatalog
|
|
185
|
-
uninstallCommonServices
|
|
186
|
-
uninstallUDS
|
|
187
|
-
uninstallMongoDb
|
|
188
|
-
uninstallSLS
|
|
189
|
-
droNamespace
|
|
180
|
+
dynClient=self.dynamicClient,
|
|
181
|
+
instanceId=instanceId,
|
|
182
|
+
certManagerProvider="redhat",
|
|
183
|
+
uninstallCertManager=uninstallCertManager,
|
|
184
|
+
uninstallGrafana=uninstallGrafana,
|
|
185
|
+
uninstallCatalog=uninstallCommonServices,
|
|
186
|
+
uninstallCommonServices=uninstallCommonServices,
|
|
187
|
+
uninstallUDS=uninstallUDS,
|
|
188
|
+
uninstallMongoDb=uninstallMongoDb,
|
|
189
|
+
uninstallSLS=uninstallSLS,
|
|
190
|
+
droNamespace=droNamespace
|
|
190
191
|
)
|
|
191
192
|
if pipelineURL is not None:
|
|
192
193
|
h.stop_and_persist(symbol=self.successIcon, text=f"PipelineRun for {instanceId} uninstall submitted")
|
mas/cli/uninstall/argParser.py
CHANGED
mas/cli/update/__init__.py
CHANGED
mas/cli/update/app.py
CHANGED
|
@@ -14,7 +14,6 @@ import logging
|
|
|
14
14
|
import logging.handlers
|
|
15
15
|
from halo import Halo
|
|
16
16
|
from prompt_toolkit import print_formatted_text, HTML
|
|
17
|
-
from prompt_toolkit.completion import WordCompleter
|
|
18
17
|
|
|
19
18
|
from openshift.dynamic.exceptions import NotFoundError, ResourceNotFoundError
|
|
20
19
|
|
|
@@ -29,6 +28,7 @@ from mas.devops.tekton import preparePipelinesNamespace, installOpenShiftPipelin
|
|
|
29
28
|
|
|
30
29
|
logger = logging.getLogger(__name__)
|
|
31
30
|
|
|
31
|
+
|
|
32
32
|
class UpdateApp(BaseApp):
|
|
33
33
|
|
|
34
34
|
def update(self, argv):
|
|
@@ -75,7 +75,7 @@ class UpdateApp(BaseApp):
|
|
|
75
75
|
self.setParam(key, value)
|
|
76
76
|
|
|
77
77
|
# Arguments that we don't need to do anything with
|
|
78
|
-
elif key in [
|
|
78
|
+
elif key in ["no_confirm", "help"]:
|
|
79
79
|
pass
|
|
80
80
|
|
|
81
81
|
# Fail if there's any arguments we don't know how to handle
|
|
@@ -105,14 +105,14 @@ class UpdateApp(BaseApp):
|
|
|
105
105
|
self.printH1("Dependency Update Checks")
|
|
106
106
|
with Halo(text='Checking for IBM Watson Discovery', spinner=self.spinner) as h:
|
|
107
107
|
if self.isWatsonDiscoveryInstalled():
|
|
108
|
-
h.stop_and_persist(symbol=self.failureIcon, text=
|
|
108
|
+
h.stop_and_persist(symbol=self.failureIcon, text="IBM Watson Discovery is installed")
|
|
109
109
|
self.fatalError("Watson Discovery is currently installed in the instance of Cloud Pak for Data that is managed by the MAS CLI (in the ibm-cpd namespace), this is no longer supported and the update can not proceed as a result. Please contact IBM support for assistance")
|
|
110
110
|
else:
|
|
111
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
111
|
+
h.stop_and_persist(symbol=self.successIcon, text="IBM Watson Discovery is not installed")
|
|
112
112
|
|
|
113
113
|
with Halo(text='Checking for IBM Certificate-Manager', spinner=self.spinner) as h:
|
|
114
114
|
if self.isIBMCertManagerInstalled():
|
|
115
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
115
|
+
h.stop_and_persist(symbol=self.successIcon, text="IBM Certificate-Manager will be replaced by Red Hat Certificate-Manager")
|
|
116
116
|
self.setParam("cert_manager_action", "install")
|
|
117
117
|
self.setParam("cert_manager_provider", "redhat")
|
|
118
118
|
self.printHighlight([
|
|
@@ -122,7 +122,7 @@ class UpdateApp(BaseApp):
|
|
|
122
122
|
""
|
|
123
123
|
])
|
|
124
124
|
else:
|
|
125
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
125
|
+
h.stop_and_persist(symbol=self.successIcon, text="IBM Certificate-Manager is not installed")
|
|
126
126
|
|
|
127
127
|
self.detectUDS()
|
|
128
128
|
self.detectGrafana4()
|
|
@@ -160,7 +160,7 @@ class UpdateApp(BaseApp):
|
|
|
160
160
|
self.printSummary("Apache Kafka", "No action required")
|
|
161
161
|
|
|
162
162
|
if self.getParam("cp4d_update") != "":
|
|
163
|
-
self.printSummary("IBM Cloud Pak for Data",
|
|
163
|
+
self.printSummary("IBM Cloud Pak for Data", "Platform and services in ibm-cpd")
|
|
164
164
|
else:
|
|
165
165
|
self.printSummary("IBM Cloud Pak for Data", "No action required")
|
|
166
166
|
|
|
@@ -180,11 +180,11 @@ class UpdateApp(BaseApp):
|
|
|
180
180
|
self.createTektonFileWithDigest()
|
|
181
181
|
|
|
182
182
|
self.printH1("Launch Update")
|
|
183
|
-
pipelinesNamespace =
|
|
183
|
+
pipelinesNamespace = "mas-pipelines"
|
|
184
184
|
|
|
185
185
|
with Halo(text='Validating OpenShift Pipelines installation', spinner=self.spinner) as h:
|
|
186
186
|
installOpenShiftPipelines(self.dynamicClient)
|
|
187
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
187
|
+
h.stop_and_persist(symbol=self.successIcon, text="OpenShift Pipelines Operator is installed and ready to use")
|
|
188
188
|
|
|
189
189
|
with Halo(text=f'Preparing namespace ({pipelinesNamespace})', spinner=self.spinner) as h:
|
|
190
190
|
createNamespace(self.dynamicClient, pipelinesNamespace)
|
|
@@ -195,13 +195,13 @@ class UpdateApp(BaseApp):
|
|
|
195
195
|
updateTektonDefinitions(pipelinesNamespace, self.tektonDefsPath)
|
|
196
196
|
h.stop_and_persist(symbol=self.successIcon, text=f"Latest Tekton definitions are installed (v{self.version})")
|
|
197
197
|
|
|
198
|
-
with Halo(text=
|
|
198
|
+
with Halo(text="Submitting PipelineRun for MAS update", spinner=self.spinner) as h:
|
|
199
199
|
pipelineURL = launchUpdatePipeline(dynClient=self.dynamicClient, params=self.params)
|
|
200
200
|
if pipelineURL is not None:
|
|
201
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
201
|
+
h.stop_and_persist(symbol=self.successIcon, text="PipelineRun for MAS update submitted")
|
|
202
202
|
print_formatted_text(HTML(f"\nView progress:\n <Cyan><u>{pipelineURL}</u></Cyan>\n"))
|
|
203
203
|
else:
|
|
204
|
-
h.stop_and_persist(symbol=self.failureIcon, text=
|
|
204
|
+
h.stop_and_persist(symbol=self.failureIcon, text="Failed to submit PipelineRun for MAS update, see log file for details")
|
|
205
205
|
print()
|
|
206
206
|
|
|
207
207
|
def reviewCurrentCatalog(self) -> None:
|
|
@@ -220,7 +220,7 @@ class UpdateApp(BaseApp):
|
|
|
220
220
|
self.installedCatalogId = "v8-amd64"
|
|
221
221
|
else:
|
|
222
222
|
self.installedCatalogId = None
|
|
223
|
-
self.printWarning(
|
|
223
|
+
self.printWarning("Unable to determine identity & version of currently installed ibm-maximo-operator-catalog")
|
|
224
224
|
|
|
225
225
|
self.printH1("Review Installed Catalog")
|
|
226
226
|
self.printDescription([
|
|
@@ -237,7 +237,7 @@ class UpdateApp(BaseApp):
|
|
|
237
237
|
suites = listMasInstances(self.dynamicClient)
|
|
238
238
|
for suite in suites:
|
|
239
239
|
self.printDescription([f"- <u>{suite['metadata']['name']}</u> v{suite['status']['versions']['reconciled']}"])
|
|
240
|
-
except ResourceNotFoundError
|
|
240
|
+
except ResourceNotFoundError:
|
|
241
241
|
self.fatalError("No MAS instances were detected on the cluster (Suite.core.mas.ibm.com/v1 API is not available). See log file for details")
|
|
242
242
|
|
|
243
243
|
def chooseCatalog(self) -> None:
|
|
@@ -250,7 +250,7 @@ class UpdateApp(BaseApp):
|
|
|
250
250
|
])
|
|
251
251
|
|
|
252
252
|
catalogOptions = [
|
|
253
|
-
|
|
253
|
+
"v9-241003-amd64", "v9-240827-amd64", "v9-240730-amd64"
|
|
254
254
|
]
|
|
255
255
|
self.promptForListSelect("Select catalog version", catalogOptions, "mas_catalog_version", default=1)
|
|
256
256
|
|
|
@@ -265,7 +265,7 @@ class UpdateApp(BaseApp):
|
|
|
265
265
|
if len(wds) > 0:
|
|
266
266
|
return True
|
|
267
267
|
return False
|
|
268
|
-
except (ResourceNotFoundError, NotFoundError)
|
|
268
|
+
except (ResourceNotFoundError, NotFoundError):
|
|
269
269
|
# Watson Discovery has never been installed on this cluster
|
|
270
270
|
return False
|
|
271
271
|
|
|
@@ -301,7 +301,7 @@ class UpdateApp(BaseApp):
|
|
|
301
301
|
# For testing, comment out the lines above and set grafanaVersion4s to a simple list
|
|
302
302
|
# grafanaVersion4s = ["hello"]
|
|
303
303
|
if len(grafanaVersion4s) > 0:
|
|
304
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
304
|
+
h.stop_and_persist(symbol=self.successIcon, text="Grafana Operator v4 instance will be updated to v5")
|
|
305
305
|
self.printDescription([
|
|
306
306
|
"<u>Dependency Upgrade Notice</u>",
|
|
307
307
|
"Grafana Operator v4 is currently installed and will be updated to v5",
|
|
@@ -310,10 +310,10 @@ class UpdateApp(BaseApp):
|
|
|
310
310
|
])
|
|
311
311
|
self.setParam("grafana_v5_upgrade", "true")
|
|
312
312
|
else:
|
|
313
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
313
|
+
h.stop_and_persist(symbol=self.successIcon, text="Grafana Operator v4 is not installed")
|
|
314
314
|
return
|
|
315
|
-
except (ResourceNotFoundError, NotFoundError)
|
|
316
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
315
|
+
except (ResourceNotFoundError, NotFoundError):
|
|
316
|
+
h.stop_and_persist(symbol=self.successIcon, text="Grafana Operator v4 is not installed")
|
|
317
317
|
|
|
318
318
|
def detectMongoDb(self) -> None:
|
|
319
319
|
with Halo(text='Checking for MongoDb CE', spinner=self.spinner) as h:
|
|
@@ -387,10 +387,10 @@ class UpdateApp(BaseApp):
|
|
|
387
387
|
h.stop_and_persist(symbol=self.successIcon, text=f"MongoDb CE is aleady installed at version {targetMongoVersion}")
|
|
388
388
|
else:
|
|
389
389
|
# There's no MongoDb instance installed in the cluster, so nothing to do
|
|
390
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
391
|
-
except (ResourceNotFoundError, NotFoundError)
|
|
390
|
+
h.stop_and_persist(symbol=self.successIcon, text="No MongoDb CE instances found")
|
|
391
|
+
except (ResourceNotFoundError, NotFoundError):
|
|
392
392
|
# There's no MongoDb instance installed in the cluster, so nothing to do
|
|
393
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
393
|
+
h.stop_and_persist(symbol=self.successIcon, text="MongoDb CE is not installed")
|
|
394
394
|
|
|
395
395
|
def showMongoDependencyUpdateNotice(self, currentMongoVersion, targetMongoVersion) -> None:
|
|
396
396
|
self.printHighlight([
|
|
@@ -422,24 +422,24 @@ class UpdateApp(BaseApp):
|
|
|
422
422
|
# analyticsProxies = ["foo"]
|
|
423
423
|
if len(analyticsProxies) == 0:
|
|
424
424
|
logger.debug("UDS is not currently installed on this cluster")
|
|
425
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
425
|
+
h.stop_and_persist(symbol=self.successIcon, text="IBM User Data Services is not installed")
|
|
426
426
|
else:
|
|
427
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
427
|
+
h.stop_and_persist(symbol=self.successIcon, text="IBM User Data Services must be migrated to IBM Data Reporter Operator")
|
|
428
428
|
|
|
429
429
|
if self.noConfirm and self.getParam("dro_migration") != "true":
|
|
430
430
|
# The user has chosen not to provide confirmation but has not provided the flag to pre-approve the migration
|
|
431
|
-
h.stop_and_persist(symbol=self.failureIcon, text=
|
|
431
|
+
h.stop_and_persist(symbol=self.failureIcon, text="IBM User Data Services needs to be migrated to IBM Data Reporter Operator")
|
|
432
432
|
self.showUDSUpdateNotice()
|
|
433
433
|
self.fatalError(f"By choosing {self.getParam('mas_catalog_version')} you must confirm the migration to DRO using '--dro-migration' when using '--no-confirm'")
|
|
434
434
|
elif self.noConfirm and self.getParam("dro_storage_class") is None:
|
|
435
435
|
# The user has not provided the storage class to use for DRO, but has disabled confirmations/interactive prompts
|
|
436
|
-
h.stop_and_persist(symbol=self.failureIcon, text=
|
|
436
|
+
h.stop_and_persist(symbol=self.failureIcon, text="IBM User Data Services needs to be migrated to IBM Data Reporter Operator")
|
|
437
437
|
self.showUDSUpdateNotice()
|
|
438
438
|
self.fatalError(f"By choosing {self.getParam('mas_catalog_version')} you must provide the storage class to use for the migration to DRO using '--dro-storage-class' when using '--no-confirm'")
|
|
439
439
|
else:
|
|
440
440
|
h.stop_and_persist(symbol=self.successIcon, text="IBM User Data Services needs to be migrated to IBM Data Reporter Operator")
|
|
441
441
|
self.showUDSUpdateNotice()
|
|
442
|
-
if self.getParam("dro_migration") == "true" and self.getParam("dro_storage_class") is None:
|
|
442
|
+
if self.getParam("dro_migration") == "true" and self.getParam("dro_storage_class") is None:
|
|
443
443
|
if not self.yesOrNo("Confirm migration from UDS to DRO", "dro_migration"):
|
|
444
444
|
# If the user did not approve the update, abort
|
|
445
445
|
exit(1)
|
|
@@ -454,10 +454,10 @@ class UpdateApp(BaseApp):
|
|
|
454
454
|
if self.getParam("dro_migration") == "true":
|
|
455
455
|
self.setParam("uds_action", "install-dro")
|
|
456
456
|
|
|
457
|
-
except (ResourceNotFoundError, NotFoundError)
|
|
457
|
+
except (ResourceNotFoundError, NotFoundError):
|
|
458
458
|
# UDS has never been installed on this cluster
|
|
459
459
|
logger.debug("UDS has not been installed on this cluster before")
|
|
460
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
460
|
+
h.stop_and_persist(symbol=self.successIcon, text="IBM User Data Services is not installed")
|
|
461
461
|
|
|
462
462
|
def detectCP4D(self) -> bool:
|
|
463
463
|
# Important:
|
|
@@ -470,7 +470,7 @@ class UpdateApp(BaseApp):
|
|
|
470
470
|
"v9-240730-amd64": "4.8.0",
|
|
471
471
|
"v9-240827-amd64": "4.8.0",
|
|
472
472
|
"v9-241003-amd64": "4.8.0"
|
|
473
|
-
|
|
473
|
+
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
with Halo(text='Checking for IBM Cloud Pak for Data', spinner=self.spinner) as h:
|
|
@@ -501,14 +501,14 @@ class UpdateApp(BaseApp):
|
|
|
501
501
|
|
|
502
502
|
if cpdInstanceVersion < cpdTargetVersion:
|
|
503
503
|
# We have to update CP4D
|
|
504
|
-
h.stop_and_persist(symbol=self.successIcon, text=f"IBM Cloud Pak for Data {cpdInstanceVersion} needs to be updated to {cpdTargetVersion}")
|
|
504
|
+
h.stop_and_persist(symbol=self.successIcon, text=f"IBM Cloud Pak for Data ({cpdInstanceNamespace}) {cpdInstanceVersion} needs to be updated to {cpdTargetVersion}")
|
|
505
505
|
|
|
506
506
|
if currentCpdVersionMajorMinor < targetCpdVersionMajorMinor:
|
|
507
507
|
# We only show the "backup first" notice for minor CP4D updates
|
|
508
508
|
self.printHighlight([
|
|
509
509
|
""
|
|
510
510
|
"<u>Dependency Update Notice</u>",
|
|
511
|
-
f"Cloud Pak For Data is currently running version {cpdInstanceVersion} and will be updated to version {cpdTargetVersion}",
|
|
511
|
+
f"Cloud Pak For Data ({cpdInstanceNamespace}) is currently running version {cpdInstanceVersion} and will be updated to version {cpdTargetVersion}",
|
|
512
512
|
"It is recommended that you backup your Cloud Pak for Data instance before proceeding:",
|
|
513
513
|
" <u>https://www.ibm.com/docs/en/cloud-paks/cp-data/5.0.x?topic=administering-backing-up-restoring-cloud-pak-data</u>"
|
|
514
514
|
])
|
|
@@ -545,11 +545,11 @@ class UpdateApp(BaseApp):
|
|
|
545
545
|
self.detectCpdService('Spss', 'spssmodeler.cpd.ibm.com/v1', 'SPSS Modeler', "cp4d_update_spss")
|
|
546
546
|
self.detectCpdService('CAService', 'ca.cpd.ibm.com/v1', 'Cognos Analytics', "cp4d_update_cognos")
|
|
547
547
|
else:
|
|
548
|
-
h.stop_and_persist(symbol=self.successIcon, text=f"IBM Cloud Pak for Data is already installed at version {cpdTargetVersion}")
|
|
548
|
+
h.stop_and_persist(symbol=self.successIcon, text=f"IBM Cloud Pak for Data ({cpdInstanceNamespace}) is already installed at version {cpdTargetVersion}")
|
|
549
549
|
else:
|
|
550
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
551
|
-
except (ResourceNotFoundError, NotFoundError)
|
|
552
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
550
|
+
h.stop_and_persist(symbol=self.successIcon, text="No IBM Cloud Pak for Data instance found")
|
|
551
|
+
except (ResourceNotFoundError, NotFoundError):
|
|
552
|
+
h.stop_and_persist(symbol=self.successIcon, text="IBM Cloud Pak for Data is not installed")
|
|
553
553
|
|
|
554
554
|
def detectCpdService(self, kind: str, api: str, name: str, param: str) -> None:
|
|
555
555
|
try:
|
|
@@ -618,7 +618,7 @@ class UpdateApp(BaseApp):
|
|
|
618
618
|
else:
|
|
619
619
|
logger.debug(f"Found no instances of {kind} to update")
|
|
620
620
|
h.stop_and_persist(symbol=self.successIcon, text=f"Found no {kind} ({apiVersion}) instances to update")
|
|
621
|
-
except (ResourceNotFoundError, NotFoundError)
|
|
621
|
+
except (ResourceNotFoundError, NotFoundError):
|
|
622
622
|
logger.debug(f"{kind}.{apiVersion} is not available in the cluster")
|
|
623
623
|
h.stop_and_persist(symbol=self.successIcon, text=f"{kind}.{apiVersion} is not available in the cluster")
|
|
624
624
|
|
|
@@ -633,7 +633,7 @@ class UpdateApp(BaseApp):
|
|
|
633
633
|
self.setParam("kafka_provider", "redhat")
|
|
634
634
|
elif sub["spec"]["name"] == "strimzi-kafka-operator":
|
|
635
635
|
self.setParam("kafka_provider", "strimzi")
|
|
636
|
-
except (ResourceNotFoundError, NotFoundError)
|
|
636
|
+
except (ResourceNotFoundError, NotFoundError):
|
|
637
637
|
pass
|
|
638
638
|
|
|
639
639
|
# If the param is still undefined then there is a big problem
|
mas/cli/update/argParser.py
CHANGED
mas/cli/upgrade/__init__.py
CHANGED
mas/cli/upgrade/app.py
CHANGED
|
@@ -17,8 +17,8 @@ from prompt_toolkit.completion import WordCompleter
|
|
|
17
17
|
|
|
18
18
|
from halo import Halo
|
|
19
19
|
|
|
20
|
-
from ..cli import BaseApp
|
|
21
|
-
from ..validators import InstanceIDValidator
|
|
20
|
+
from ..cli import BaseApp
|
|
21
|
+
from ..validators import InstanceIDValidator
|
|
22
22
|
from .argParser import upgradeArgParser
|
|
23
23
|
|
|
24
24
|
from mas.devops.ocp import createNamespace
|
|
@@ -27,6 +27,7 @@ from mas.devops.tekton import installOpenShiftPipelines, updateTektonDefinitions
|
|
|
27
27
|
|
|
28
28
|
logger = logging.getLogger(__name__)
|
|
29
29
|
|
|
30
|
+
|
|
30
31
|
class UpgradeApp(BaseApp):
|
|
31
32
|
def upgrade(self, argv):
|
|
32
33
|
"""
|
|
@@ -56,7 +57,7 @@ class UpgradeApp(BaseApp):
|
|
|
56
57
|
suiteOptions = []
|
|
57
58
|
|
|
58
59
|
if len(suites) == 0:
|
|
59
|
-
print_formatted_text(HTML(
|
|
60
|
+
print_formatted_text(HTML("<Red>Error: No MAS instances detected on this cluster</Red>"))
|
|
60
61
|
sys.exit(1)
|
|
61
62
|
|
|
62
63
|
for suite in suites:
|
|
@@ -65,7 +66,7 @@ class UpgradeApp(BaseApp):
|
|
|
65
66
|
|
|
66
67
|
suiteCompleter = WordCompleter(suiteOptions)
|
|
67
68
|
print()
|
|
68
|
-
instanceId = prompt(HTML(
|
|
69
|
+
instanceId = prompt(HTML('<Yellow>Enter MAS instance ID: </Yellow>'), completer=suiteCompleter, validator=InstanceIDValidator(), validate_while_typing=False)
|
|
69
70
|
else:
|
|
70
71
|
# Non-interactive mode
|
|
71
72
|
if not verifyMasInstance(self.dynamicClient, instanceId):
|
|
@@ -78,9 +79,9 @@ class UpgradeApp(BaseApp):
|
|
|
78
79
|
|
|
79
80
|
if not self.noConfirm:
|
|
80
81
|
print()
|
|
81
|
-
continueWithUpgrade =
|
|
82
|
+
continueWithUpgrade = self.yesOrNo("Proceed with these settings?")
|
|
82
83
|
|
|
83
|
-
if self.noConfirm or continueWithUpgrade
|
|
84
|
+
if self.noConfirm or continueWithUpgrade:
|
|
84
85
|
self.createTektonFileWithDigest()
|
|
85
86
|
|
|
86
87
|
self.printH1("Launch Upgrade")
|
|
@@ -88,7 +89,7 @@ class UpgradeApp(BaseApp):
|
|
|
88
89
|
|
|
89
90
|
with Halo(text='Validating OpenShift Pipelines installation', spinner=self.spinner) as h:
|
|
90
91
|
installOpenShiftPipelines(self.dynamicClient)
|
|
91
|
-
h.stop_and_persist(symbol=self.successIcon, text=
|
|
92
|
+
h.stop_and_persist(symbol=self.successIcon, text="OpenShift Pipelines Operator is installed and ready to use")
|
|
92
93
|
|
|
93
94
|
with Halo(text=f'Preparing namespace ({pipelinesNamespace})', spinner=self.spinner) as h:
|
|
94
95
|
createNamespace(self.dynamicClient, pipelinesNamespace)
|
mas/cli/upgrade/argParser.py
CHANGED
|
@@ -27,6 +27,7 @@ from kubernetes.client.exceptions import ApiException
|
|
|
27
27
|
|
|
28
28
|
logger = logging.getLogger(__name__)
|
|
29
29
|
|
|
30
|
+
|
|
30
31
|
def usage():
|
|
31
32
|
print_formatted_text(HTML(""))
|
|
32
33
|
|
|
@@ -36,15 +37,16 @@ def usage():
|
|
|
36
37
|
print_formatted_text(HTML("Important Notice:\nThis standalone CLI (<ForestGreen>mas-cli</ForestGreen>) is still in beta state, not all functions supported by the <ForestGreen>mas</ForestGreen> function in quay.io/ibmmas/cli are supported yet"))
|
|
37
38
|
print("")
|
|
38
39
|
print_formatted_text(HTML(
|
|
39
|
-
"<b>MAS Management Actions:</b>\n"
|
|
40
|
-
" - <ForestGreen>mas-cli install</ForestGreen> Install IBM Maximo Application Suite\n"
|
|
41
|
-
" - <ForestGreen>mas-cli update</ForestGreen> Apply updates and security fixes\n"
|
|
42
|
-
" - <ForestGreen>mas-cli upgrade</ForestGreen> Upgrade to a new MAS release\n"
|
|
43
|
-
" - <ForestGreen>mas-cli uninstall</ForestGreen> Remove MAS from the cluster\n"
|
|
40
|
+
"<b>MAS Management Actions:</b>\n"
|
|
41
|
+
+ " - <ForestGreen>mas-cli install</ForestGreen> Install IBM Maximo Application Suite\n" # noqa: W503
|
|
42
|
+
+ " - <ForestGreen>mas-cli update</ForestGreen> Apply updates and security fixes\n" # noqa: W503
|
|
43
|
+
+ " - <ForestGreen>mas-cli upgrade</ForestGreen> Upgrade to a new MAS release\n" # noqa: W503
|
|
44
|
+
+ " - <ForestGreen>mas-cli uninstall</ForestGreen> Remove MAS from the cluster\n" # noqa: W503
|
|
44
45
|
|
|
45
46
|
))
|
|
46
47
|
print_formatted_text(HTML("For usage information run <ForestGreen>mas-cli [action] --help</ForestGreen>\n"))
|
|
47
48
|
|
|
49
|
+
|
|
48
50
|
if __name__ == '__main__':
|
|
49
51
|
try:
|
|
50
52
|
function = argv[1]
|
|
@@ -69,7 +71,7 @@ if __name__ == '__main__':
|
|
|
69
71
|
print_formatted_text(HTML(f"<Red>Unknown action: {function}</Red>\n"))
|
|
70
72
|
exit(1)
|
|
71
73
|
|
|
72
|
-
except KeyboardInterrupt
|
|
74
|
+
except KeyboardInterrupt:
|
|
73
75
|
pass
|
|
74
76
|
except ApiException as e:
|
|
75
77
|
app.fatalError(message=f"An error occured communicating with the target server: {e.reason} ({e.status})", exception=e)
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
mas/cli/__init__.py,sha256=
|
|
2
|
-
mas/cli/cli.py,sha256=
|
|
3
|
-
mas/cli/displayMixins.py,sha256=
|
|
4
|
-
mas/cli/gencfg.py,sha256=
|
|
1
|
+
mas/cli/__init__.py,sha256=D1f2jkgfxrbZ6T4a5OZ9u-gRHXaEZVcbM6JAqA0hLrA,526
|
|
2
|
+
mas/cli/cli.py,sha256=kvTyPU89BdyzZbbn9Lb3iWtgdyfoPURayPa6Fa6qI9w,14372
|
|
3
|
+
mas/cli/displayMixins.py,sha256=VVL2kWzPTqNQy63WT-tYIDnYa7SX3w33QX2XjSWVHWk,5636
|
|
4
|
+
mas/cli/gencfg.py,sha256=BbWCyX6soIwQWcsKCLDTY0VkipLd944cuIAFpAWWXpA,2107
|
|
5
5
|
mas/cli/validators.py,sha256=vi1pFA8QtqMhqtGk1NlkkNDUrlFCi53kS5wJqFGDgOU,5108
|
|
6
|
-
mas/cli/install/__init__.py,sha256=
|
|
7
|
-
mas/cli/install/app.py,sha256=
|
|
8
|
-
mas/cli/install/argBuilder.py,sha256=
|
|
9
|
-
mas/cli/install/argParser.py,sha256=
|
|
10
|
-
mas/cli/install/summarizer.py,sha256=
|
|
11
|
-
mas/cli/install/settings/__init__.py,sha256=
|
|
12
|
-
mas/cli/install/settings/additionalConfigs.py,sha256=
|
|
13
|
-
mas/cli/install/settings/db2Settings.py,sha256=
|
|
14
|
-
mas/cli/install/settings/kafkaSettings.py,sha256=
|
|
15
|
-
mas/cli/install/settings/manageSettings.py,sha256=
|
|
16
|
-
mas/cli/install/settings/turbonomicSettings.py,sha256=
|
|
17
|
-
mas/cli/templates/ibm-mas-tekton.yaml,sha256=
|
|
6
|
+
mas/cli/install/__init__.py,sha256=v0WJlcdrSycWGT5ofFjRDV3jTZ8AqVCz1AGxok4Khtc,508
|
|
7
|
+
mas/cli/install/app.py,sha256=l3--R0T4jl_UqpEPOD7aiAZLB9b5bQzXDM71scLKJDo,56142
|
|
8
|
+
mas/cli/install/argBuilder.py,sha256=QdRGZ7F_NcZPfBsrandlPsrDEdJpNTUXE5ZkiDDSasg,22171
|
|
9
|
+
mas/cli/install/argParser.py,sha256=_ogzep-z2Sp2DV_eS7PxkQVmikYJWTWC567nk8IyF0Q,26836
|
|
10
|
+
mas/cli/install/summarizer.py,sha256=YdCNzhDNEqI2ovGVTVutTzifJ1WOU-x5bWxiWc7BqXo,18904
|
|
11
|
+
mas/cli/install/settings/__init__.py,sha256=wvprrlWi-j9SPwERiJkZdNKC99g_3QZ0h6lMn1gNGqE,962
|
|
12
|
+
mas/cli/install/settings/additionalConfigs.py,sha256=hz0gtNimwcWC7iwKQof9SzqWYeJ_Cfp9X0fnwgOnS50,9543
|
|
13
|
+
mas/cli/install/settings/db2Settings.py,sha256=0gR3nkr-xeR3cUgBzXWvatSgZf1fv2SbDdbxjBRBFG0,10712
|
|
14
|
+
mas/cli/install/settings/kafkaSettings.py,sha256=OWE5MV--h2fTtATMQiaGQq1FXIMXzaTAPGE_6-vXoWU,6998
|
|
15
|
+
mas/cli/install/settings/manageSettings.py,sha256=A9X9oDKlEnNTRQKs2BMjahYH40w0pQTq2mQ6gBC6vi4,13946
|
|
16
|
+
mas/cli/install/settings/turbonomicSettings.py,sha256=qy1SBjWJw1AHfRQoLv8uB9DO_QFcGa8hZp1fhdM0dY8,1589
|
|
17
|
+
mas/cli/templates/ibm-mas-tekton.yaml,sha256=HoSzxREShQ22-rc3Vn8k2Gml6qcy9n-HkQ1FcmwW428,739922
|
|
18
18
|
mas/cli/templates/jdbccfg.yml.j2,sha256=cANbwkUkKEPQp-P3_BB_Llbt94457Ciagah2hOdySIM,1644
|
|
19
19
|
mas/cli/templates/pod-templates/best-effort/ibm-data-dictionary-assetdatadictionary.yml,sha256=8VG_FDFcEjWNaAOZTcS58Pe0tWOXC10SJLloNqzEMC8,757
|
|
20
20
|
mas/cli/templates/pod-templates/best-effort/ibm-mas-bascfg.yml,sha256=rkq8c2pVJoskgict9tCZzCchGSE2MBC-dJ47JyMYm7A,1559
|
|
@@ -86,17 +86,17 @@ mas/cli/templates/pod-templates/guaranteed/ibm-mas-smtpcfg.yml,sha256=fbBe8S5iHH
|
|
|
86
86
|
mas/cli/templates/pod-templates/guaranteed/ibm-mas-suite.yml,sha256=aB-buCWUAqD0PV9zcGrPI5gm8QWUHZgxdriw_HG85q0,7656
|
|
87
87
|
mas/cli/templates/pod-templates/guaranteed/ibm-mas-visualinspection.yml,sha256=NiXBlXKe3j2RvroEcx3kCSuD92G6WB-jcpNAYGAg3T0,1975
|
|
88
88
|
mas/cli/templates/pod-templates/guaranteed/ibm-sls-licenseservice.yml,sha256=CKt1yim4L3ClloVcQDHiXLD8EMvmKXIltmDxJTxNdDs,546
|
|
89
|
-
mas/cli/uninstall/__init__.py,sha256=
|
|
90
|
-
mas/cli/uninstall/app.py,sha256=
|
|
91
|
-
mas/cli/uninstall/argParser.py,sha256=
|
|
92
|
-
mas/cli/update/__init__.py,sha256=
|
|
93
|
-
mas/cli/update/app.py,sha256=
|
|
94
|
-
mas/cli/update/argParser.py,sha256=
|
|
95
|
-
mas/cli/upgrade/__init__.py,sha256=
|
|
96
|
-
mas/cli/upgrade/app.py,sha256=
|
|
97
|
-
mas/cli/upgrade/argParser.py,sha256=
|
|
98
|
-
mas_cli-11.
|
|
99
|
-
mas_cli-11.
|
|
100
|
-
mas_cli-11.
|
|
101
|
-
mas_cli-11.
|
|
102
|
-
mas_cli-11.
|
|
89
|
+
mas/cli/uninstall/__init__.py,sha256=v0WJlcdrSycWGT5ofFjRDV3jTZ8AqVCz1AGxok4Khtc,508
|
|
90
|
+
mas/cli/uninstall/app.py,sha256=uPJy3z-1Yt66MSFdZz1Qh8MjA97ZrQmjSgTx-Gqua9I,10047
|
|
91
|
+
mas/cli/uninstall/argParser.py,sha256=VVG4myUvFOtg98L6HAzpgGg7s5c-vub_UMZPGuNQko4,3452
|
|
92
|
+
mas/cli/update/__init__.py,sha256=v0WJlcdrSycWGT5ofFjRDV3jTZ8AqVCz1AGxok4Khtc,508
|
|
93
|
+
mas/cli/update/app.py,sha256=loh76IOo3h4gx9VUe4m27nqcI2_h2fK9h1uRvCZGOGE,37729
|
|
94
|
+
mas/cli/update/argParser.py,sha256=oOIXzB_rsI2p3og_5X5SFt_g7LURyEdLxZeiGCKq1nU,4711
|
|
95
|
+
mas/cli/upgrade/__init__.py,sha256=v0WJlcdrSycWGT5ofFjRDV3jTZ8AqVCz1AGxok4Khtc,508
|
|
96
|
+
mas/cli/upgrade/app.py,sha256=f1qfvzRdmf7YiYMtVTqKwE5RFVMcUkLGavCIZDuU_7c,5247
|
|
97
|
+
mas/cli/upgrade/argParser.py,sha256=zk629svjIk-hD40Ytc5e5UOLO3xogVrfqSz09S17mWw,1882
|
|
98
|
+
mas_cli-11.5.0.data/scripts/mas-cli,sha256=Es-wSefTBcR3Vs5_kIUHQLfWHxTXVrmIPMFY0hbrxt8,3493
|
|
99
|
+
mas_cli-11.5.0.dist-info/METADATA,sha256=LhOWslhpZpDATByWyWLW6luT4kHfLY1vcFZ-z4cHX6w,2076
|
|
100
|
+
mas_cli-11.5.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
101
|
+
mas_cli-11.5.0.dist-info/top_level.txt,sha256=_Hlsp7pvMvyV14LFg-vk1hULq30j61EILnnxMFIhhc8,4
|
|
102
|
+
mas_cli-11.5.0.dist-info/RECORD,,
|
|
File without changes
|