Skip to content

Commit

Permalink
fix(vclusterctl): limit updating vCluster server address to local for…
Browse files Browse the repository at this point in the history
… OSS vClusters only
  • Loading branch information
neogopher committed Jun 5, 2024
1 parent 40fefe2 commit 7ad8e26
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/vclusterctl/cmd/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,14 @@ func (cmd *ConnectCmd) executeCommand(vKubeConfig clientcmdapi.Config, command [
func (cmd *ConnectCmd) getLocalVClusterConfig(vKubeConfig clientcmdapi.Config) clientcmdapi.Config {
// wait until we can access the virtual cluster
vKubeConfig = *vKubeConfig.DeepCopy()
for k := range vKubeConfig.Clusters {
vKubeConfig.Clusters[k].Server = "https://localhost:" + strconv.Itoa(cmd.LocalPort)

// update vCluster server address in case of OSS vClusters only
if cmd.LocalPort != 0 {
for k := range vKubeConfig.Clusters {
vKubeConfig.Clusters[k].Server = "https://localhost:" + strconv.Itoa(cmd.LocalPort)
}
}

return vKubeConfig
}

Expand Down

0 comments on commit 7ad8e26

Please sign in to comment.