Skip to content

fix: respect -preserve-ns flag in processors#193

Open
girdharshubham wants to merge 2 commits intoarttor:mainfrom
girdharshubham:fix/preserve-ns-cert-issuer-sa
Open

fix: respect -preserve-ns flag in processors#193
girdharshubham wants to merge 2 commits intoarttor:mainfrom
girdharshubham:fix/preserve-ns-cert-issuer-sa

Conversation

@girdharshubham
Copy link

@girdharshubham girdharshubham commented Feb 17, 2026

Certificate and Issuer processors used hardcoded templates that never included the namespace field, even when -preserve-ns was set. Refactored both to use ProcessObjMeta for metadata generation, which already handles namespace preservation. Cert-manager hook annotations are injected onto the object before calling ProcessObjMeta when -cert-manager-as-subchart is enabled.

ServiceAccount retains its custom template but now conditionally injects the namespace when -preserve-ns is set.

RoleBinding and ClusterRoleBinding processors unconditionally replaced subject namespaces with {{ .Release.Namespace }}. With -preserve-ns, the original subject namespace is now preserved.

Also fixed a pre-existing bug where Issuer processor was not passing values to issResult, causing webhook.enabled to be silently dropped.

Fixes #192

…ount processors

Certificate and Issuer processors used hardcoded templates that never
included the namespace field, even when -preserve-ns was set. Refactored
both to use ProcessObjMeta for metadata generation, which already handles
namespace preservation. Cert-manager hook annotations are injected onto
the object before calling ProcessObjMeta when -cert-manager-as-subchart
is enabled.

ServiceAccount retains its custom template but now conditionally injects
the namespace when -preserve-ns is set.

Also fixed a pre-existing bug where Issuer processor was not passing
values to issResult, causing webhook.enabled to be silently dropped.

Fixes arttor#192
@girdharshubham girdharshubham changed the title fix: respect -preserve-ns flag in Certificate, Issuer, and ServiceAccount processors fix: respect -preserve-ns flag in processors Feb 17, 2026
…leBinding with -preserve-ns

When -preserve-ns is set, keep the original namespace on binding subjects
instead of replacing it with {{ .Release.Namespace }}. This ensures
correct ServiceAccount references in umbrella chart deployments where
the release namespace differs from the target namespace.
@girdharshubham girdharshubham force-pushed the fix/preserve-ns-cert-issuer-sa branch from 8b6e706 to 9d6f48a Compare February 17, 2026 12:26
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.

Certificate, Issuer, and ServiceAccount processors ignore -preserve-ns flag

1 participant

Comments