Skip to content

Commit

Permalink
minor changes 4
Browse files Browse the repository at this point in the history
Signed-off-by: kaizhe <derek0405@gmail.com>
  • Loading branch information
Kaizhe committed Apr 2, 2020
1 parent 1e4adff commit ff2a236
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -117,7 +124,7 @@ func main() {
const (
defaultBinary = "kube-apparmor-manager"

kubectlBinary = "kubectl apparmor-manager"
kubectlBinary = "apparmor-manager"
)

func getBinary(arg string) string {
Expand Down

0 comments on commit ff2a236

Please sign in to comment.