Skip to content

Commit

Permalink
Running internal kubectl command when minikube is called as 'kubectl'
Browse files Browse the repository at this point in the history
Fixes issue #8857

Signed-off-by: Pablo Caderno <[email protected]>
  • Loading branch information
kadern0 committed Jul 29, 2020
1 parent f8406b6 commit f42bdcf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/minikube/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
goflag "flag"
"fmt"
"os"
"path/filepath"
"runtime"
"strings"

Expand Down Expand Up @@ -73,6 +74,10 @@ var RootCmd = &cobra.Command{
// Execute adds all child commands to the root command sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
_, callingCmd := filepath.Split(os.Args[0])
if callingCmd == "kubectl" {
os.Args = append([]string{"minikube", callingCmd}, os.Args[1:]...)
}
for _, c := range RootCmd.Commands() {
c.Short = translate.T(c.Short)
c.Long = translate.T(c.Long)
Expand Down

0 comments on commit f42bdcf

Please sign in to comment.