kubearmor / kubearmor-client

KubeArmor cli tool aka kArmor :robot:
Apache License 2.0
34 stars 82 forks source link

Remove usage of sudo to install kubearmor-client #416

Closed lekaf974 closed 5 months ago

lekaf974 commented 5 months ago

Fix #415

Result

[lekaf974@~ ]$ curl -sfL http://get.kubearmor.io/ | sh -s -- -b "$HOME/.local/bin"
kubearmor/kubearmor-client info checking GitHub for latest tag
kubearmor/kubearmor-client info found version: 1.2.0 for v1.2.0/linux/amd64
kubearmor/kubearmor-client info installed /home/lekaf974/.local/bin/karmor
kubearmor/kubearmor-client info Add /home/lekaf974/.local/bin to your PATH
lekaf974 commented 5 months ago

This way we are asking users to add ~/.local/bin which a user might not want.

Can we use install it in bin directory of the current working directory? And print a log message to move karmor to any location which is already present in PATH.

mv ./bin/karmor ~/.local/bin or any other path as per user preference.

If we intend to use ~/.local/bin then the PR looks good to me.

@kranurag7: Just needed to validate, I replaced /usr/local/bin to ~/.local.bin just to be able to install without sudo. I took ~/.local/bin since -b option was already present. I can simply remove the option that way the binary will be installed in ./bin which is the default behavior in the script

If it makes sense let me know so I'll make proper change.

@DelusionalOptimist any preference ?