Skip to content

Commit

Permalink
Delete redundant logic to get kubeConfigPath
Browse files Browse the repository at this point in the history
- change to use already present util function
 to set up kubeConfigPath

Co-authored-by: sopahlHong <[email protected]>
Co-authored-by: woohhan <[email protected]>
Signed-off-by: anencore94 <[email protected]>
  • Loading branch information
3 people committed Feb 10, 2020
1 parent 2080f7b commit eaa8891
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions cmd/minikube/cmd/update-context.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ limitations under the License.
package cmd

import (
"os"

"github.com/spf13/cobra"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/kubeconfig"
"k8s.io/minikube/pkg/minikube/machine"
Expand All @@ -47,13 +44,7 @@ var updateContextCmd = &cobra.Command{
if err != nil {
exit.WithError("Error host driver ip status", err)
}
var updated bool
kubeConfigPath := os.Getenv("KUBECONFIG")
if kubeConfigPath == "" {
updated, err = kubeconfig.UpdateIP(ip, machineName, constants.KubeconfigPath)
} else {
updated, err = kubeconfig.UpdateIP(ip, machineName, kubeConfigPath)
}
updated, err := kubeconfig.UpdateIP(ip, machineName, kubeconfig.PathFromEnv())
if err != nil {
exit.WithError("update config", err)
}
Expand Down

0 comments on commit eaa8891

Please sign in to comment.