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
This commit is contained in:
rachelwang20 2020-07-24 13:23:26 -07:00 committed by GitHub
parent 1a36fd178a
commit 7a348f786b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}