Skip to content

Commit

Permalink
fix cli upgrade mgmt kubeconfig flag (#6666)
Browse files Browse the repository at this point in the history
* fix cli upgrade mgmt kubeconfig flag

* move to common validation
  • Loading branch information
ddjjia authored Sep 8, 2023
1 parent 526d12e commit 4454e7b
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 @@ -214,6 +214,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 4454e7b

Please sign in to comment.