Skip to content

Commit

Permalink
uninstall: remove cilium-config-agent role/rolebinding
Browse files Browse the repository at this point in the history
This commit adds the removal of the cilium-config-agent role and
rolebinding (introduced in cilium/cilium#22656) during the
uninstallation process, to ensure that the status of the cluster is
properly restored.

Signed-off-by: Marco Iorio <[email protected]>
  • Loading branch information
giorio94 authored and tklauser committed Feb 10, 2023
1 parent 44acf5a commit a8bd8f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const (
AgentServiceAccountName = "cilium"
AgentClusterRoleName = "cilium"
AgentSecretsRoleName = "cilium-secrets"
AgentConfigRoleName = "cilium-config-agent"
AgentDaemonSetName = "cilium"
AgentPodSelector = "k8s-app=cilium"
AgentResourceQuota = "cilium-resource-quota"
Expand Down
3 changes: 3 additions & 0 deletions install/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func (k *K8sUninstaller) Uninstall(ctx context.Context) error {
k.client.DeleteServiceAccount(ctx, k.params.Namespace, defaults.OperatorServiceAccountName, metav1.DeleteOptions{})
k.Log("🔥 Deleting ConfigMap...")
k.client.DeleteConfigMap(ctx, k.params.Namespace, defaults.ConfigMapName, metav1.DeleteOptions{})
k.Log("🔥 Deleting Roles...")
k.client.DeleteRole(ctx, k.params.Namespace, defaults.AgentConfigRoleName, metav1.DeleteOptions{})
k.client.DeleteRoleBinding(ctx, k.params.Namespace, defaults.AgentConfigRoleName, metav1.DeleteOptions{})
k.Log("🔥 Deleting Cluster roles...")
k.client.DeleteClusterRole(ctx, defaults.AgentClusterRoleName, metav1.DeleteOptions{})
k.client.DeleteClusterRoleBinding(ctx, defaults.AgentClusterRoleName, metav1.DeleteOptions{})
Expand Down

0 comments on commit a8bd8f1

Please sign in to comment.