From bec31da16d0ac2252099bb3c9bd428bf0ae482f2 Mon Sep 17 00:00:00 2001 From: Alexander Matyushentsev Date: Mon, 19 Mar 2018 11:03:47 -0700 Subject: [PATCH] Issue #43 - Don't setup RBAC resources for clusters with basic authentication --- cmd/argocd/commands/cluster.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/argocd/commands/cluster.go b/cmd/argocd/commands/cluster.go index 65728a538d93d..8f8b263e91935 100644 --- a/cmd/argocd/commands/cluster.go +++ b/cmd/argocd/commands/cluster.go @@ -65,8 +65,10 @@ func NewClusterAddCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clie conf, err := clientConfig.ClientConfig() errors.CheckError(err) - // Install RBAC resources for managing the cluster - conf.BearerToken = common.InstallClusterManagerRBAC(conf) + if conf.Username == "" || conf.Password == "" { + // Install RBAC resources for managing the cluster if username and password are not specified + conf.BearerToken = common.InstallClusterManagerRBAC(conf) + } conn, clusterIf := argocdclient.NewClientOrDie(clientOpts).NewClusterClientOrDie() defer util.Close(conn)