From 6e138eeebca5ceef69fcaca6cb146bb4135db75b Mon Sep 17 00:00:00 2001 From: Josh De Winne Date: Tue, 11 Nov 2025 13:32:19 -0800 Subject: [PATCH] fix: let api check cluster state --- cli/cmd/cluster_kubeconfig.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/cli/cmd/cluster_kubeconfig.go b/cli/cmd/cluster_kubeconfig.go index 63d59713e..4c1164cd2 100644 --- a/cli/cmd/cluster_kubeconfig.go +++ b/cli/cmd/cluster_kubeconfig.go @@ -10,7 +10,6 @@ import ( "github.com/pkg/errors" "github.com/replicatedhq/replicated/pkg/platformclient" - "github.com/replicatedhq/replicated/pkg/types" "github.com/spf13/cobra" "k8s.io/client-go/tools/clientcmd" ) @@ -91,17 +90,6 @@ func (r *runners) kubeconfigCluster(_ *cobra.Command, args []string) error { return errors.New("must provide cluster id or name") } - cluster, err := r.kotsAPI.GetCluster(clusterID) - if errors.Cause(err) == platformclient.ErrForbidden { - return ErrCompatibilityMatrixTermsNotAccepted - } else if err != nil { - return errors.Wrap(err, "get cluster") - } - - if cluster.Status != types.ClusterStatusRunning { - return errors.Errorf("cluster %s is not running, current status is %s", clusterID, cluster.Status) - } - kubeconfig, err := r.kotsAPI.GetClusterKubeconfig(clusterID) if errors.Cause(err) == platformclient.ErrForbidden { return ErrCompatibilityMatrixTermsNotAccepted