Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
EVEREST-203 Do not run registration for already registered k8s clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
gen1us2k committed Sep 25, 2023
1 parent 0082d28 commit 23f7073
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/install/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,16 @@ func (o *Operators) provisionMonitoring() error {

// connectToEverest connects the k8s cluster to Everest.
func (o *Operators) connectToEverest(ctx context.Context) (*client.KubernetesCluster, error) {
clusters, err := o.everestClient.ListKubernetesClusters(ctx)
if err != nil {
return nil, errors.Join(err, errors.New("could not list kubernetes clusters"))
}
for _, cluster := range clusters {
if cluster.Name == &o.config.Name {
// Cluster is already registered. Do nothing
return cluster, nil
}
}
if err := o.prepareServiceAccount(); err != nil {
return nil, errors.Join(err, errors.New("could not prepare a service account"))
}
Expand Down

0 comments on commit 23f7073

Please sign in to comment.