diff --git a/src/argument_verifier.go b/src/argument_verifier.go index 4e1b68f6..cc5066f6 100644 --- a/src/argument_verifier.go +++ b/src/argument_verifier.go @@ -7,22 +7,22 @@ import ( ) const ( - envOsUsername string = "OS_USERNAME" - envOsPassword string = "OS_PASSWORD" - envOsDomainName string = "OS_DOMAIN_NAME" - envOsUserDomainId string = "OS_USER_DOMAIN_ID" - envOsProjectName string = "OS_PROJECT_NAME" - envIdpName string = "IDP_NAME" - envIdpUrl string = "IDP_URL" - envClientId string = "CLIENT_ID" - envClientSecret string = "CLIENT_SECRET" - envClusterName string = "CLUSTER_NAME" - - authTypeIDP string = "idp" - authTypeIAM string = "iam" - - protocolSAML string = "saml" - protocolOIDC string = "oidc" + envOsUsername = "OS_USERNAME" + envOsPassword = "OS_PASSWORD" + envOsDomainName = "OS_DOMAIN_NAME" + envOsUserDomainId = "OS_USER_DOMAIN_ID" + envOsProjectName = "OS_PROJECT_NAME" + envIdpName = "IDP_NAME" + envIdpUrl = "IDP_URL" + envClientId = "CLIENT_ID" + envClientSecret = "CLIENT_SECRET" + envClusterName = "CLUSTER_NAME" + + authTypeIDP = "idp" + authTypeIAM = "iam" + + protocolSAML = "saml" + protocolOIDC = "oidc" ) func getProjectNameOrThrow(projectName string) string { @@ -38,7 +38,7 @@ func getClusterNameOrThrow(clusterName string) string { return clusterName } - return getEnvironmentVariableOrThrow(clusterName, envClusterName) + return getEnvironmentVariableOrThrow(clusterArg, envClusterName) } func getIdpInfoOrThrow(provider string, url string) (string, string) { diff --git a/src/cce/cce.go b/src/cce/cce.go index a4b5fb50..5a379de8 100644 --- a/src/cce/cce.go +++ b/src/cce/cce.go @@ -137,7 +137,7 @@ func getClusterId(clusterName string, projectName string) (clusterId string, err Id: cluster.Metadata.UID, }) } - println(fmt.Sprintf("Clustes for project %s:\n%s", projectName, strings.Join(clusters.GetClusterNames(), ",\n"))) + println(fmt.Sprintf("Clusters for project %s:\n%s", projectName, strings.Join(clusters.GetClusterNames(), ",\n"))) config.UpdateClusters(clusters) cloud = config.GetActiveCloudConfig() diff --git a/src/main.go b/src/main.go index 29b27e8c..d33944dd 100644 --- a/src/main.go +++ b/src/main.go @@ -28,6 +28,7 @@ const ( idpUrlArg = "idp-url" clientIdArg = "client-id" clientSecretArg = "client-secret" + clusterArg = "cluster" ) func main() { @@ -91,7 +92,7 @@ func main() { // Get Kubernetes Configuration getKubeConfigCommand := cceCommand.NewCommand("get-kube-config", "Get remote kube config and merge it with existing local config file.") - clusterName := getKubeConfigCommand.String("c", "cluster", &argparse.Options{Required: false, Help: fmt.Sprintf("Name of the cluster you want to access %s %s.", provideArgumentHelp, envClusterName)}) + clusterName := getKubeConfigCommand.String("c", clusterArg, &argparse.Options{Required: false, Help: fmt.Sprintf("Name of the clusterArg you want to access %s %s.", provideArgumentHelp, envClusterName)}) daysValid := getKubeConfigCommand.String("v", "days-valid", &argparse.Options{Required: false, Help: "Period (in days) that the config will be valid", Default: "7"}) // AK/SK Management