diff --git a/flake.nix b/flake.nix index 59c63ff..1e163ab 100644 --- a/flake.nix +++ b/flake.nix @@ -39,7 +39,7 @@ pname = "nais-cli"; inherit version; src = ./.; - vendorHash = "sha256-/dwDhskU2f+2y0KaPvmOhwH3VphqtN/PlpjMe7jJqFw="; + vendorHash = "sha256-WE5WSOOAUBEfxF/NAaVjTFBZeMRA3APmOJGbBueKObo="; postInstall = '' mv $out/bin/cli $out/bin/nais ''; diff --git a/pkg/kubeconfig/gcpcluster.go b/pkg/kubeconfig/gcpcluster.go index 46f9434..85367fb 100644 --- a/pkg/kubeconfig/gcpcluster.go +++ b/pkg/kubeconfig/gcpcluster.go @@ -93,13 +93,22 @@ func getGCPClusters(ctx context.Context, project project) ([]k8sCluster, error) var clusters []k8sCluster for _, cluster := range response.Clusters { + // Skip legacy clusters + if project.Tenant == "nav" && slices.Contains([]string{"dev-gcp"}, cluster.Name) { + continue + } + name := cluster.Name if cluster.Name == "knada-gke" { name = "knada" } + if project.Tenant == "nav" && cluster.Name == "nais-dev" { + name = "dev-gcp" + } + kind := project.Kind - if slices.Contains([]string{"dev-gcp", "prod-gcp", "ci-gcp"}, name) { + if slices.Contains([]string{"prod-gcp", "ci-gcp"}, name) { kind = kindLegacy }