Skip to content

Commit

Permalink
Rename kubeConfig -> kubeConfigFile (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha committed Jan 5, 2018
1 parent aab58c7 commit 81ed0ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/config/config.go
Expand Up @@ -28,7 +28,7 @@ type ClusterConfig struct {
NotifierSecretName string `json:"notifierSecretName,omitempty"`
Janitors []JanitorSpec `json:"janitors,omitempty"`
APIServer APIServerSpec `json:"apiServer,omitempty"`
KubeConfig string `json:"kubeConfig,omitempty"`
KubeConfigFile string `json:"kubeConfigFile,omitempty"`
}

type APIServerSpec struct {
Expand Down
8 changes: 4 additions & 4 deletions pkg/operator/operator.go
Expand Up @@ -131,23 +131,23 @@ func (op *Operator) Setup() error {
}

// Parse external kubeconfig file, assume that it doesn't include source cluster
if op.Config.KubeConfig != "" {
kConfig, err := clientcmd.LoadFromFile(op.Config.KubeConfig)
if op.Config.KubeConfigFile != "" {
kConfig, err := clientcmd.LoadFromFile(op.Config.KubeConfigFile)
if err != nil {
return fmt.Errorf("failed to parse context list. Reason: %v", err)
}

for contextName := range kConfig.Contexts {
ctx := syncer.ClusterContext{}

cfg, err := clientcmd_util.BuildConfigFromContext(op.Config.KubeConfig, contextName)
cfg, err := clientcmd_util.BuildConfigFromContext(op.Config.KubeConfigFile, contextName)
if err != nil {
continue
}
if ctx.Client, err = kubernetes.NewForConfig(cfg); err != nil {
continue
}
if ctx.Namespace, err = clientcmd_util.NamespaceFromContext(op.Config.KubeConfig, contextName); err != nil {
if ctx.Namespace, err = clientcmd_util.NamespaceFromContext(op.Config.KubeConfigFile, contextName); err != nil {
continue
}

Expand Down

0 comments on commit 81ed0ac

Please sign in to comment.