mas-cli 10.1.1__py3-none-any.whl → 10.2.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 CHANGED
@@ -8,4 +8,4 @@
8
8
  #
9
9
  # *****************************************************************************
10
10
 
11
- __version__ = "10.1.1"
11
+ __version__ = "10.2.0"
mas/cli/cli.py CHANGED
@@ -75,9 +75,13 @@ class BaseApp(PrintMixin, PromptMixin):
75
75
  self.templatesDir = path.join(path.abspath(path.dirname(__file__)), "templates")
76
76
  self.tektonDefsPath = path.join(self.templatesDir, "ibm-mas-tekton.yaml")
77
77
 
78
- # These dicts will hold the additional-configs and pod-templates secrets
78
+ # Initialize the dictionary that will hold the parameters we pass to a PipelineRun
79
+ self.params = dict()
80
+
81
+ # These dicts will hold the additional-configs, pod-templates and manual certificates secrets
79
82
  self.additionalConfigsSecret = None
80
83
  self.podTemplatesSecret = None
84
+ self.certsSecret = None
81
85
 
82
86
  self._isSNO = None
83
87
 
@@ -124,7 +128,7 @@ class BaseApp(PrintMixin, PromptMixin):
124
128
  self.printTitle(f"\nIBM Maximo Application Suite Admin CLI v{self.version}")
125
129
  print_formatted_text(HTML("Powered by <DarkGoldenRod><u>https://github.com/ibm-mas/ansible-devops/</u></DarkGoldenRod> and <DarkGoldenRod><u>https://tekton.dev/</u></DarkGoldenRod>\n"))
126
130
  if which("kubectl") is None:
127
- self.fatalError("Could not find kubectl on the path, see <u>https://kubernetes.io/docs/tasks/tools/#kubectl</u> for installation instructions")
131
+ self.fatalError("Could not find kubectl on the path, see <DarkGoldenRod><u>https://kubernetes.io/docs/tasks/tools/#kubectl</u></DarkGoldenRod> for installation instructions")
128
132
 
129
133
  def getCompatibleVersions(self, coreChannel: str, appId: str) -> list:
130
134
  if coreChannel in self.compatibilityMatrix:
@@ -136,10 +140,10 @@ class BaseApp(PrintMixin, PromptMixin):
136
140
  if exception is not None:
137
141
  logger.error(message)
138
142
  logger.exception(exception, stack_info=True)
139
- print_formatted_text(HTML(f"<Red>Fatal Exception: {message.replace(' & ', ' &amp; ')}: {exception}</Red>"))
143
+ print_formatted_text(HTML(f"<Red>Fatal Exception: {message.replace(' & ', ' &amp; ')}: {exception}</Red>\n"))
140
144
  else:
141
145
  logger.error(message)
142
- print_formatted_text(HTML(f"<Red>Fatal Error: {message.replace(' & ', ' &amp; ')}</Red>"))
146
+ print_formatted_text(HTML(f"<Red>Fatal Error: {message.replace(' & ', ' &amp; ')}</Red>\n"))
143
147
  exit(1)
144
148
 
145
149
  def isSNO(self):
mas/cli/displayMixins.py CHANGED
@@ -45,6 +45,15 @@ class PrintMixin():
45
45
  content[len(content) - 1] = f"{content[len(content) - 1]}</{DESCRIPTIONCOLOR}>"
46
46
  print_formatted_text(HTML("\n".join(content)))
47
47
 
48
+ def printHighlight(self, message: str) -> None:
49
+ if isinstance(message, list):
50
+ message = "\n".join(message)
51
+
52
+ print_formatted_text(HTML(f"<MediumTurquoise>{message.replace(' & ', ' &amp; ')}</MediumTurquoise>"))
53
+
54
+ def printWarning(self, message):
55
+ print_formatted_text(HTML(f"<Red>Warning: {message.replace(' & ', ' &amp; ')}</Red>"))
56
+
48
57
  def printSummary(self, title: str, value: str) -> None:
49
58
  titleLength = len(title)
50
59
  message = f"{title} {'.' * (40 - titleLength)} {value}"
mas/cli/install/app.py CHANGED
@@ -284,6 +284,11 @@ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGe
284
284
  self.setParam("dns_provider", "")
285
285
  self.setParam("mas_domain", "")
286
286
  self.setParam("mas_cluster_issuer", "")
287
+ self.manualCerts = self.yesOrNo("Configure manual certificates")
288
+ self.setParam("mas_manual_cert_mgmt", self.manualCerts)
289
+ if self.getParam("mas_manual_cert_mgmt"):
290
+ self.manualCertsDir = self.promptForDir("Enter the path containing the manual certificates", mustExist=True)
291
+ self.setParam("mas_manual_cert_dir", self.manualCertsDir)
287
292
 
288
293
  def configDNSAndCertsCloudflare(self):
289
294
  # User has chosen to set up DNS integration with Cloudflare
@@ -301,8 +306,8 @@ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGe
301
306
  ])
302
307
  certIssuer = self.promptForInt("Certificate issuer")
303
308
  certIssuerOptions = [
304
- f"${self.getParam('mas_instance_id')}-cloudflare-le-prod",
305
- f"${self.getParam('mas_instance_id')}-cloudflare-le-stg",
309
+ f"{self.getParam('mas_instance_id')}-cloudflare-le-prod",
310
+ f"{self.getParam('mas_instance_id')}-cloudflare-le-stg",
306
311
  ""
307
312
  ]
308
313
  self.setParam("mas_cluster_issuer", certIssuerOptions[certIssuer-1])
@@ -322,8 +327,8 @@ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGe
322
327
  ])
323
328
  certIssuer = self.promptForInt("Certificate issuer")
324
329
  certIssuerOptions = [
325
- f"${self.getParam('mas_instance_id')}-cis-le-prod",
326
- f"${self.getParam('mas_instance_id')}-cis-le-stg",
330
+ f"{self.getParam('mas_instance_id')}-cis-le-prod",
331
+ f"{self.getParam('mas_instance_id')}-cis-le-stg",
327
332
  ""
328
333
  ]
329
334
  self.setParam("mas_cluster_issuer", certIssuerOptions[certIssuer-1])
@@ -764,6 +769,13 @@ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGe
764
769
  elif key in ["accept_license", "dev_mode", "skip_pre_check", "no_confirm", "no_wait_for_pvc", "help"]:
765
770
  pass
766
771
 
772
+ elif key == "manual_certificates":
773
+ if value is not None:
774
+ self.setParam("mas_manual_cert_mgmt", True)
775
+ self.setParam("mas_manual_cert_dir", value)
776
+ else:
777
+ self.setParam("mas_manual_cert_mgmt", False)
778
+
767
779
  # Fail if there's any arguments we don't know how to handle
768
780
  else:
769
781
  print(f"Unknown option: {key} {value}")
@@ -793,9 +805,6 @@ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGe
793
805
  # Store all args
794
806
  self.args = args
795
807
 
796
- # Initialize the dictionary that will hold the parameters we pass to the PipelineRun
797
- self.params = dict()
798
-
799
808
  # These flags work for setting params in both interactive and non-interactive modes
800
809
  if args.skip_pre_check:
801
810
  self.setParam("skip_pre_check", "true")
@@ -819,7 +828,7 @@ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGe
819
828
  "catalog": "v9-240625-amd64",
820
829
  "release": "8.11.x",
821
830
  "core": "8.11.12",
822
- "assist": "8.8.4",
831
+ "assist": "N/A",
823
832
  "iot": "8.8.10",
824
833
  "manage": "8.7.9",
825
834
  "monitor": "8.11.8",
@@ -832,12 +841,12 @@ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGe
832
841
  "catalog": "v9-240625-amd64",
833
842
  "release": "8.10.x",
834
843
  "core": "8.10.15",
835
- "assist": "8.7.5",
844
+ "assist": "N/A",
836
845
  "iot": "8.7.14",
837
846
  "manage": "8.6.15",
838
847
  "monitor": "8.10.11",
839
848
  "optimizer": "8.4.7",
840
- "predict": "8.8.2",
849
+ "predict": "N/A",
841
850
  "inspection": "8.8.4"
842
851
  },
843
852
  {
@@ -845,7 +854,7 @@ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGe
845
854
  "catalog": "v8-240528-amd64",
846
855
  "release": "8.11.x",
847
856
  "core": "8.11.11",
848
- "assist": "8.8.3",
857
+ "assist": "N/A",
849
858
  "iot": "8.8.9",
850
859
  "manage": "8.7.8",
851
860
  "monitor": "8.11.7",
@@ -858,12 +867,12 @@ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGe
858
867
  "catalog": "v8-240528-amd64",
859
868
  "release": "8.10.x",
860
869
  "core": "8.10.14",
861
- "assist": "8.7.4",
870
+ "assist": "N/A",
862
871
  "iot": "8.7.13",
863
872
  "manage": "8.6.14",
864
873
  "monitor": "8.10.10",
865
874
  "optimizer": "8.4.6",
866
- "predict": "8.8.2",
875
+ "predict": "N/A",
867
876
  "inspection": "8.8.4"
868
877
  }
869
878
  ]
@@ -902,9 +911,10 @@ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGe
902
911
  entitlementFileBaseName = path.basename(self.slsLicenseFileLocal)
903
912
  self.setParam("sls_entitlement_file", f"/workspace/entitlement/{entitlementFileBaseName}")
904
913
 
905
- # Set up the secrets for additional configs and podtemplates
914
+ # Set up the secrets for additional configs, podtemplates and manual certificates
906
915
  self.additionalConfigs()
907
916
  self.podTemplates()
917
+ self.manualCertificates()
908
918
 
909
919
  # Show a summary of the installation configuration
910
920
  self.displayInstallSummary()
@@ -945,7 +955,8 @@ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGe
945
955
  instanceId=self.getParam("mas_instance_id"),
946
956
  slsLicenseFile=self.slsLicenseFileLocal,
947
957
  additionalConfigs=self.additionalConfigsSecret,
948
- podTemplates=self.podTemplatesSecret
958
+ podTemplates=self.podTemplatesSecret,
959
+ certs=self.certsSecret
949
960
  )
950
961
  h.stop_and_persist(symbol=self.successIcon, text=f"Namespace is ready ({pipelinesNamespace})")
951
962