Skip to content

Fix orphan no-permission ServiceAccount in kubernetes-novolume mode#4455

Open
khaykingleb wants to merge 1 commit intoactions:masterfrom
khaykingleb:fix-no-permission-sa-kubernetes-novolume
Open

Fix orphan no-permission ServiceAccount in kubernetes-novolume mode#4455
khaykingleb wants to merge 1 commit intoactions:masterfrom
khaykingleb:fix-no-permission-sa-kubernetes-novolume

Conversation

@khaykingleb
Copy link
Copy Markdown

Fixes #4454

When containerMode.type is kubernetes-novolume, the chart renders a <release>-gha-rs-no-permission ServiceAccount that the runner pod never uses (it uses the kube-mode SA instead). The SA is created with a actions.github.com/cleanup-protection finalizer, but the AutoscalingRunnerSet has no cleanup-no-permission-service-account-name annotation for this mode, so autoscalingRunnerSetFinalizerDependencyCleaner.removeNoPermissionServiceAccountFinalizer skips it on teardown. The SA becomes an orphan that blocks helm uninstall / Argo CD app deletion until someone manually strips the finalizer.

Fix

Align the creation condition with where the SA is actually used and tracked:

-{{- if and (ne $containerMode.type "kubernetes") (not .Values.template.spec.serviceAccountName) }}
+{{- if and (ne $containerMode.type "kubernetes") (ne $containerMode.type "kubernetes-novolume") (not .Values.template.spec.serviceAccountName) }}

Tests

Added a table-driven test that renders the chart in both kubernetes and kubernetes-novolume modes and asserts templates/no_permission_serviceaccount.yaml produces no output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Orphan no-permission ServiceAccount in kubernetes-novolume mode blocks Argo CD app teardown

1 participant