Skip to content

Commit

Permalink
Merge pull request #382 from Ankurk99/fix-uninstall
Browse files Browse the repository at this point in the history
fix `karmor uninstall`
  • Loading branch information
Ankurk99 authored Nov 17, 2023
2 parents 57a92f9 + fffae68 commit 7b409be
Show file tree
Hide file tree
Showing 9 changed files with 353 additions and 134 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-ginkgo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "v1.20"
go-version: "v1.21"
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.3.0
- name: Test connectivity
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: "v1.20"
go-version: "v1.21"

- name: Build karmor
run: make
Expand All @@ -31,7 +31,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: "v1.20"
go-version: "v1.21"

- name: Check gofmt
run: make gofmt
Expand All @@ -44,7 +44,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: "v1.20"
go-version: "v1.21"

- name: Run Gosec Security Scanner
run: make gosec
Expand All @@ -68,7 +68,7 @@ jobs:

- uses: actions/setup-go@v2
with:
go-version: "v1.20"
go-version: "v1.21"

- name: Run unit tests
run: make test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.20"
go-version: "1.21"

- name: Install Cosign
uses: sigstore/cosign-installer@main
Expand Down
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")
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kubearmor/kubearmor-client

go 1.20
go 1.21

replace (
github.com/etcd-io/bbolt => go.etcd.io/bbolt v1.3.6
Expand Down
46 changes: 46 additions & 0 deletions go.sum

Large diffs are not rendered by default.

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"
var KubeArmorOperatorManageClusterRoleName = "kubearmor-operator-manage-kubearmor-clusterrole"
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 7b409be

Please sign in to comment.