Skip to content

Commit

Permalink
fix karmor uninstall
Browse files Browse the repository at this point in the history
Signed-off-by: Ankur Kothiwal <[email protected]>
  • Loading branch information
Ankurk99 committed Nov 17, 2023
1 parent 57a92f9 commit 800a93d
Show file tree
Hide file tree
Showing 3 changed files with 299 additions and 126 deletions.
2 changes: 1 addition & 1 deletion cmd/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var uninstallCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(uninstallCmd)

uninstallCmd.Flags().StringVarP(&uninstallOptions.Namespace, "namespace", "n", "kubearmor", "Namespace for resources")
uninstallCmd.Flags().StringVarP(&uninstallOptions.Namespace, "namespace", "n", "", "If no namespace is specified, it defaults to all namespaces and deletes all KubeArmor objects across them.")
uninstallCmd.Flags().BoolVar(&uninstallOptions.Force, "force", false, "Force remove KubeArmor annotations from deployments. (Deployments might be restarted)")
uninstallCmd.Flags().BoolVar(&uninstallOptions.Verify, "verify", true, "Verify whether all KubeArmor resources are cleaned up or not")
}
18 changes: 17 additions & 1 deletion install/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,23 @@ package install
var kubearmor = "kubearmor"

var serviceAccountName = kubearmor
var clusterRoleBindingName = "kubearmor-clusterrolebinding"
var operatorServiceAccountName = "kubearmor-operator"
var KubeArmorOperatorClusterRoleName = "kubearmor-operator-clusterrole"

Check warning on line 10 in install/defaults.go

View workflow job for this annotation

GitHub Actions / go-lint

exported var KubeArmorOperatorClusterRoleName should have comment or be unexported
var KubeArmorOperatorManageClusterRoleName = "kubearmor-operator-manage-kubearmor-clusterrole"

Check warning on line 11 in install/defaults.go

View workflow job for this annotation

GitHub Actions / go-lint

exported var KubeArmorOperatorManageClusterRoleName should have comment or be unexported
var KubeArmorOperatorManageControllerClusterRoleName = "kubearmor-operator-manage-controller-clusterrole"
var KubeArmorClusterRoleName = "kubearmor-clusterrole"
var KubeArmorControllerClusterRoleName = "kubearmor-controller-clusterrole"
var KubeArmorSnitchClusterRoleName = "kubearmor-snitch"
var KubeArmorControllerProxyClusterRoleName = "kubearmor-controller-proxy-role"

var KubeArmorSnitchClusterroleBindingName = "kubearmor-snitch-binding"
var KubeArmorControllerProxyClusterRoleBindingName = "kubearmor-controller-proxy-rolebinding"
var KubeArmorControllerClusterRoleBindingName = "kubearmor-controller-clusterrolebinding"
var KubeArmorClusterRoleBindingName = "kubearmor-clusterrolebinding"
var KubeArmorOperatorManageControllerClusterRoleBindingName = "kubearmor-operator-manage-controller-clusterrole-binding"
var KubeArmorOperatorManageClusterRoleBindingName = "kubearmor-operator-manage-kubearmor-clusterrole-binding"
var KubeArmorOperatorClusterRoleBindingName = "kubearmor-operator-clusterrole-binding"

var relayServiceName = kubearmor
var relayDeploymentName = "kubearmor-relay"
var policyManagerServiceName = "kubearmor-policy-manager-metrics-service"
Expand Down
Loading

0 comments on commit 800a93d

Please sign in to comment.