Skip to content

Commit

Permalink
support legacy inside tenant projects
Browse files Browse the repository at this point in the history
  • Loading branch information
sechmann committed Sep 20, 2024
1 parent beb5e55 commit a257c5b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/kubeconfig/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package kubeconfig
import (
"encoding/base64"
"fmt"
"slices"

"github.com/nais/narcos/internal/gcp"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
Expand Down Expand Up @@ -45,7 +46,10 @@ func addCluster(config *clientcmdapi.Config, cluster gcp.Cluster, overwrite, ver
CertificateAuthorityData: ca,
}

if cluster.Kind == gcp.KindLegacy {
legacyClusters := []string{"dev-gcp", "prod-gcp", "ci-gcp"}
isLegacy := cluster.Kind == gcp.KindLegacy || slices.Contains(legacyClusters, cluster.Name)

if isLegacy {
kubeconfigCluster.CertificateAuthorityData = nil
kubeconfigCluster.InsecureSkipTLSVerify = true
kubeconfigCluster.Server = gcp.GetClusterServerForLegacyGCP(cluster.Name)
Expand Down

0 comments on commit a257c5b

Please # to comment.