From 7a348f786bc5debeb3ceef996220ec81fdb12691 Mon Sep 17 00:00:00 2001 From: rachelwang20 <62673041+rachelwang20@users.noreply.github.com> Date: Fri, 24 Jul 2020 13:23:26 -0700 Subject: [PATCH] feat: Allow custom cluster names (#3985) * Include sub and and iat in PermissionDenied message * Run test-local * Fix typo * Fix lint error * iat fromat changing * Adding MapClaims convertion * Fix lint issue * Fix golang lint * Fix blank space * Fix missing field * Adding Orphaned exception list * Fixed lint error * Rebased on master * Adding group kind label * golangci-lint run * Addressed comments * Fixed lint errors * Method rename * orphaned ignore list cli support * Orphaned resources cli support * Display orphaned resource cli * Added tests * Create argocd app resources command * Addressed comments * fix a lint error --- cmd/argocd/commands/cluster.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/argocd/commands/cluster.go b/cmd/argocd/commands/cluster.go index 594e014809..74b609a59c 100644 --- a/cmd/argocd/commands/cluster.go +++ b/cmd/argocd/commands/cluster.go @@ -65,6 +65,7 @@ func NewClusterAddCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clie awsClusterName string systemNamespace string namespaces []string + name string ) var command = &cobra.Command{ Use: "add CONTEXT", @@ -111,6 +112,9 @@ func NewClusterAddCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clie } conn, clusterIf := argocdclient.NewClientOrDie(clientOpts).NewClusterClientOrDie() defer io.Close(conn) + if name != "" { + contextName = name + } clst := newCluster(contextName, namespaces, conf, managerBearerToken, awsAuthConf) if inCluster { clst.Server = common.KubernetesInternalAPIServerAddr @@ -132,6 +136,7 @@ func NewClusterAddCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clie command.Flags().StringVar(&awsRoleArn, "aws-role-arn", "", "Optional AWS role arn. If set then AWS IAM Authenticator assume a role to perform cluster operations instead of the default AWS credential provider chain.") command.Flags().StringVar(&systemNamespace, "system-namespace", common.DefaultSystemNamespace, "Use different system namespace") command.Flags().StringArrayVar(&namespaces, "namespace", nil, "List of namespaces which are allowed to manage") + command.Flags().StringVar(&name, "name", "", "Overwrite the cluster name") return command }