From e691af8db839bb82115bc49dcbcc7e643119d2c3 Mon Sep 17 00:00:00 2001 From: Artur Reznikov Date: Wed, 16 Oct 2024 21:34:46 -0700 Subject: [PATCH] fix clusterconfig to make it work like ok --- pkg/application/app.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/application/app.go b/pkg/application/app.go index 596d77032..794d9d0c3 100644 --- a/pkg/application/app.go +++ b/pkg/application/app.go @@ -804,12 +804,9 @@ func (app *Avalanche) ClusterExists(clusterName string) (bool, error) { func (app *Avalanche) GetClusterConfig(clusterName string) (models.ClusterConfig, error) { exists, err := app.ClusterExists(clusterName) - if err != nil { + if err != nil || !exists { return models.ClusterConfig{}, err } - if !exists { - return models.ClusterConfig{}, fmt.Errorf("cluster %q does not exist", clusterName) - } clustersConfig, err := app.LoadClustersConfig() if err != nil { return models.ClusterConfig{}, err