diff --git a/defaults/defaults.go b/defaults/defaults.go index 0782a1004e..3a41b7e743 100644 --- a/defaults/defaults.go +++ b/defaults/defaults.go @@ -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" diff --git a/install/uninstall.go b/install/uninstall.go index 1805f57e58..83864e656c 100644 --- a/install/uninstall.go +++ b/install/uninstall.go @@ -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{})