Skip to content

Commit

Permalink
fix(kubeconfig): fix bug skipping clusters named "...-jumphost"
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninja243 committed Oct 2, 2023
1 parent 0e2305a commit 28b54ed
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cce/kube_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ func mergeKubeConfig(configParams KubeConfigParams, kubeConfigData string) {
}

if configParams.Jumphost != "" {
for idx, cluster := range kubeConfig.Clusters {
if strings.HasSuffix(idx, "-jumphost") {
continue
}
kubeConfigBkp := kubeConfig
for idx, cluster := range kubeConfigBkp.Clusters {
clusterJumphostName := fmt.Sprintf("%s-jumphost", idx)
kubeConfig.Clusters[clusterJumphostName] = cluster
kubeConfig.Clusters[clusterJumphostName].Server = configParams.Jumphost
Expand Down

0 comments on commit 28b54ed

Please sign in to comment.