Skip to content

Commit

Permalink
add nais-dev -> dev-gcp rename, make sure nobody gets old dev-gcp
Browse files Browse the repository at this point in the history
  • Loading branch information
sechmann committed Dec 21, 2024
1 parent aeb85d9 commit 495bd34
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';
Expand Down
11 changes: 10 additions & 1 deletion pkg/kubeconfig/gcpcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 495bd34

Please sign in to comment.