diff --git a/common/python/ax/cluster_management/app/cluster_installer.py b/common/python/ax/cluster_management/app/cluster_installer.py index a7714c0bd3db..e3e66c182752 100644 --- a/common/python/ax/cluster_management/app/cluster_installer.py +++ b/common/python/ax/cluster_management/app/cluster_installer.py @@ -53,6 +53,7 @@ DEFAULT_NODE_SPOT_PRICE = "0.1512" CLUSTER_META_DATA_PATH = "/tmp/cluster_meta/metadata.yaml" ARGO_CONFIG = "/root/.argo/{fname}" +ARGO_CONFIG_DEFAULT = ARGO_CONFIG.format(fname='default') class ClusterInstaller(ClusterOperationBase): @@ -104,7 +105,8 @@ def run(self): # Dump Argo cluster profile if username and password: logger.info("Generating Argo cluster profile ...") - with open(ARGO_CONFIG.format(fname=self._idobj.get_cluster_name_id()), "w") as f: + argo_config_path = ARGO_CONFIG.format(fname=self._idobj.get_cluster_name_id()) + with open(argo_config_path, "w") as f: f.write( """ insecure: true @@ -113,6 +115,9 @@ def run(self): username: {username} """.format(password=password, dns=cluster_dns, username=username) ) + if not os.path.exists(ARGO_CONFIG_DEFAULT): + # if user has not yet configured default argo config, symlink a default config to the one just created + os.symlink(os.path.basename(argo_config_path), ARGO_CONFIG_DEFAULT) summary = """ Cluster Name: {cluster_name} diff --git a/saas/argocli/src/applatix.io/argo/cmd/login.go b/saas/argocli/src/applatix.io/argo/cmd/login.go index 30935be70a37..c9200cc58eb3 100644 --- a/saas/argocli/src/applatix.io/argo/cmd/login.go +++ b/saas/argocli/src/applatix.io/argo/cmd/login.go @@ -80,7 +80,7 @@ var loginCmd = &cobra.Command{ if axErr != nil { // TODO: need to completely rework axerror to preserve original, // underlying error and not rely on this clunky string search - if axErr.Code == axerror.ERR_AX_HTTP_CONNECTION.Code && strings.Contains(axErr.Message, "certificate is not valid") { + if axErr.Code == axerror.ERR_AX_HTTP_CONNECTION.Code && (strings.Contains(axErr.Message, "certificate is not valid") || strings.Contains(axErr.Message, "certificate is valid for")) { fmt.Printf("Cluster is using an invalid or self-signed certificate. Proceed insecurely (y/n)? ") insecure, _ := reader.ReadString('\n') insecure = strings.TrimSpace(strings.ToLower(insecure))