Skip to content

Commit

Permalink
Support multi config files
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardstudy committed Jul 2, 2019
1 parent eb53a6f commit 54ea5af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/kn/commands/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package commands

import (
"io"
"path/filepath"

serving "github.com/knative/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1"
"k8s.io/client-go/tools/clientcmd"
Expand Down Expand Up @@ -70,7 +71,8 @@ func (c *KnParams) GetConfig() (serving.ServingV1alpha1Interface, error) {
func (c *KnParams) GetClientConfig() clientcmd.ClientConfig {
loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
if len(c.KubeCfgPath) > 0 {
loadingRules.ExplicitPath = c.KubeCfgPath
paths := filepath.SplitList(c.KubeCfgPath)
loadingRules.Precedence = paths
}
return clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, &clientcmd.ConfigOverrides{})
}

0 comments on commit 54ea5af

Please sign in to comment.