Skip to content

Commit

Permalink
Issue argoproj#43 - Don't setup RBAC resources for clusters with basi…
Browse files Browse the repository at this point in the history
…c authentication
  • Loading branch information
Alexander Matyushentsev authored and Alexander Matyushentsev committed Mar 19, 2018
1 parent 363b9b3 commit bec31da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/argocd/commands/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bec31da

Please sign in to comment.