From 0208a3ee09162e40ed1ef7f9991daefa04ad1a9b Mon Sep 17 00:00:00 2001 From: Paul Barfuss Date: Fri, 10 Dec 2021 15:58:52 -0500 Subject: [PATCH] Replace hardcoded kubectl with kubectl.Name() Kubernetes-commit: 77be26c3b83dd28be450c8790ecee823750f9a8c --- pkg/cmd/completion/completion.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/cmd/completion/completion.go b/pkg/cmd/completion/completion.go index d13bba3b..8018e93f 100644 --- a/pkg/cmd/completion/completion.go +++ b/pkg/cmd/completion/completion.go @@ -171,8 +171,7 @@ func runCompletionBash(out io.Writer, boilerPlate string, kubectl *cobra.Command } func runCompletionZsh(out io.Writer, boilerPlate string, kubectl *cobra.Command) error { - commandName := kubectl.Name() - zshHead := fmt.Sprintf("#compdef %[1]s\ncompdef _%[1]s %[1]s\n", commandName) + zshHead := fmt.Sprintf("#compdef %[1]s\ncompdef _%[1]s %[1]s\n", kubectl.Name()) out.Write([]byte(zshHead)) if len(boilerPlate) == 0 {