Skip to content

Commit

Permalink
[release-0.17] fix cli upgrade mgmt kubeconfig flag (#6679)
Browse files Browse the repository at this point in the history
* fix cli upgrade mgmt kubeconfig flag

* move to common validation

* not remove log import

---------

Co-authored-by: Jia Deng <[email protected]>
Co-authored-by: Jia Deng <[email protected]>
  • Loading branch information
3 people authored Sep 13, 2023
1 parent a7a6fb4 commit aa329d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/eksctl-anywhere/cmd/upgradecluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ func (uc *upgradeClusterOptions) commonValidations(ctx context.Context) (cluster
return nil, err
}

if uc.wConfig == "" && uc.managementKubeconfig != "" && clusterConfig.IsSelfManaged() {
uc.wConfig = uc.managementKubeconfig
uc.managementKubeconfig = ""
}

kubeconfigPath := getKubeconfigPath(clusterConfig.Name, uc.wConfig)
if err := kubeconfig.ValidateFilename(kubeconfigPath); err != nil {
return nil, err
Expand Down

0 comments on commit aa329d9

Please sign in to comment.