From ff2a23661ec9932389cad882d8a54c918d177daf Mon Sep 17 00:00:00 2001 From: kaizhe Date: Wed, 1 Apr 2020 18:41:16 -0700 Subject: [PATCH] minor changes 4 Signed-off-by: kaizhe --- main.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 1e32962..7a9d192 100644 --- a/main.go +++ b/main.go @@ -33,10 +33,17 @@ func main() { }) binaryArg := getBinary(os.Args[0]) + + extBinaryArg := binaryArg + + if extBinaryArg == kubectlBinary { + extBinaryArg = fmt.Sprintf("kubectl %s", kubectlBinary) + } + var rootCmd = &cobra.Command{ Use: binaryArg, - Short: fmt.Sprintf("%s manages AppArmor service and profiles enforcement on worker nodes", binaryArg), - Long: fmt.Sprintf("%s manages AppArmor service and profiles enforcement on worker nodes through syncing with AppArmorProfile CRD in Kubernetes cluster", binaryArg), + Short: fmt.Sprintf("%s manages AppArmor service and profiles enforcement on worker nodes", extBinaryArg), + Long: fmt.Sprintf("%s manages AppArmor service and profiles enforcement on worker nodes through syncing with AppArmorProfile CRD in Kubernetes cluster", extBinaryArg), PersistentPreRun: func(cmd *cobra.Command, args []string) { lvl, err := log.ParseLevel(logLevel) if err != nil { @@ -117,7 +124,7 @@ func main() { const ( defaultBinary = "kube-apparmor-manager" - kubectlBinary = "kubectl apparmor-manager" + kubectlBinary = "apparmor-manager" ) func getBinary(arg string) string {