Merge pull request #2269 from zhuwint/devctl

Adjust the order of kubeconfig loadingRules
This commit is contained in:
karmada-bot 2022-08-05 16:45:06 +08:00 committed by GitHub
commit 8c6a357a43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -13,8 +13,8 @@ func RestConfig(context, kubeconfigPath string) (*rest.Config, error) {
pathOptions := clientcmd.NewDefaultPathOptions()
loadingRules := *pathOptions.LoadingRules
loadingRules.Precedence = pathOptions.GetLoadingPrecedence()
loadingRules.ExplicitPath = kubeconfigPath
loadingRules.Precedence = pathOptions.GetLoadingPrecedence()
overrides := &clientcmd.ConfigOverrides{
CurrentContext: context,
}

View File

@ -44,8 +44,8 @@ func (a *karmadaConfig) GetRestConfig(context, kubeconfigPath string) (*rest.Con
// context and kubeconfig passed as arguments.
func (a *karmadaConfig) GetClientConfig(context, kubeconfigPath string) clientcmd.ClientConfig {
loadingRules := *a.pathOptions.LoadingRules
loadingRules.Precedence = a.pathOptions.GetLoadingPrecedence()
loadingRules.ExplicitPath = kubeconfigPath
loadingRules.Precedence = a.pathOptions.GetLoadingPrecedence()
overrides := &clientcmd.ConfigOverrides{
CurrentContext: context,
}