Skip to content

Commit 6e138ee

Browse files
committed
fix: let api check cluster state
1 parent 6380c92 commit 6e138ee

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

cli/cmd/cluster_kubeconfig.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
"github.com/pkg/errors"
1212
"github.com/replicatedhq/replicated/pkg/platformclient"
13-
"github.com/replicatedhq/replicated/pkg/types"
1413
"github.com/spf13/cobra"
1514
"k8s.io/client-go/tools/clientcmd"
1615
)
@@ -91,17 +90,6 @@ func (r *runners) kubeconfigCluster(_ *cobra.Command, args []string) error {
9190
return errors.New("must provide cluster id or name")
9291
}
9392

94-
cluster, err := r.kotsAPI.GetCluster(clusterID)
95-
if errors.Cause(err) == platformclient.ErrForbidden {
96-
return ErrCompatibilityMatrixTermsNotAccepted
97-
} else if err != nil {
98-
return errors.Wrap(err, "get cluster")
99-
}
100-
101-
if cluster.Status != types.ClusterStatusRunning {
102-
return errors.Errorf("cluster %s is not running, current status is %s", clusterID, cluster.Status)
103-
}
104-
10593
kubeconfig, err := r.kotsAPI.GetClusterKubeconfig(clusterID)
10694
if errors.Cause(err) == platformclient.ErrForbidden {
10795
return ErrCompatibilityMatrixTermsNotAccepted

0 commit comments

Comments
 (0)