Skip to content

Commit

Permalink
We continue even if the idpbuilder cluster is not found part of the k…
Browse files Browse the repository at this point in the history
…ubeconfig file BUT we log a message

Signed-off-by: cmoulliard <[email protected]>
  • Loading branch information
cmoulliard committed Nov 22, 2024
1 parent 1f99c48 commit 031e81b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/cmd/get/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func populateClusterList() ([]Cluster, error) {
c, found := findClusterByName(config, "kind-"+cluster)
if !found {
//logger.Error(nil, fmt.Sprintf("Cluster not found: %s within kube config file\n", cluster))
return nil, err
logger.Info(fmt.Sprintf("Cluster not found: %s within kube config file\n", cluster))
} else {
cli, err := GetClientForCluster(manager, cluster)
if err != nil {
Expand Down Expand Up @@ -361,14 +361,12 @@ func CreateKubeClientForEachIDPCluster(config *api.Config, clusterList []string)
if slices.Contains(clusterList, contextName[5:]) {
cfg, err := clientcmd.NewNonInteractiveClientConfig(*config, contextName, &clientcmd.ConfigOverrides{}, nil).ClientConfig()
if err != nil {
fmt.Errorf("Failed to build client for context %s.", contextName)
continue
return nil, fmt.Errorf("Failed to build client for context %s.", contextName)
}

cl, err := client.New(cfg, client.Options{})
if err != nil {
fmt.Errorf("Failed to create client for context %s", contextName)
continue
return nil, fmt.Errorf("failed to create client for context %s", contextName)
}

manager.clients[contextName] = cl
Expand Down

0 comments on commit 031e81b

Please sign in to comment.