diff --git a/cmd/eksctl-anywhere/cmd/upgradecluster.go b/cmd/eksctl-anywhere/cmd/upgradecluster.go index 7ccad7bb0e97..cf3bd046a351 100644 --- a/cmd/eksctl-anywhere/cmd/upgradecluster.go +++ b/cmd/eksctl-anywhere/cmd/upgradecluster.go @@ -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