Skip to content

Commit

Permalink
Merge pull request #2128 from mahdix/fixed_context
Browse files Browse the repository at this point in the history
Use minikube context instead of relying on current kubcetl context
  • Loading branch information
r2d4 authored Oct 27, 2017
2 parents 69fc158 + ab6e73a commit 109a23e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/minikube/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"text/template"

"k8s.io/apimachinery/pkg/labels"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/util"
)
Expand Down Expand Up @@ -63,7 +64,12 @@ func (k *K8sClientGetter) GetCoreClient() (corev1.CoreV1Interface, error) {

func (*K8sClientGetter) GetClientset() (*kubernetes.Clientset, error) {
loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
configOverrides := &clientcmd.ConfigOverrides{}
configOverrides := &clientcmd.ConfigOverrides{
Context: clientcmdapi.Context{
Cluster: "minikube",
AuthInfo: "minikube",
},
}
kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides)
config, err := kubeConfig.ClientConfig()
if err != nil {
Expand Down

0 comments on commit 109a23e

Please sign in to comment.