Skip to content

Conversation

KyriosGN0
Copy link
Contributor

Signed-off-by: AvivGuiser [email protected]

What this PR does / why we need it

Which issue this PR fixes

This PR intorduces the option to use user namespaces in k8s version 1.33 and higher, by default it is unset.

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

Special notes for your reviewer

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

automountServiceAccountToken: true

# -- Use the host's user namespace available in kubernetes 1.33+.
hostUsers: nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why nil and not false by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to allow users to opt-in into setting this value, since its a new field in beta not all k8s distribution support it by default

Signed-off-by: AvivGuiser <[email protected]>
@KyriosGN0
Copy link
Contributor Author

sorry, rebased and had some git troubles

@KyriosGN0
Copy link
Contributor Author

hey @dotdc @tariq1890, would it be possible to get a review here?
Thanks in advance!

Comment on lines 45 to 47
{{- if and (semverCompare ">=1.33-0" .Capabilities.KubeVersion.Version) (kindIs "bool" .Values.hostUsers) }}
hostUsers: {{ .Values.hostUsers }}
{{- end }}
Copy link
Contributor

@dacamposol dacamposol Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to avoid no-op rendering. Current implementation would only apply the field if the value is a boolean, but Helm will render nothing if it's not, which may be difficult to debug.

I would recommend something more idiomatic, like:

Suggested change
{{- if and (semverCompare ">=1.33-0" .Capabilities.KubeVersion.Version) (kindIs "bool" .Values.hostUsers) }}
hostUsers: {{ .Values.hostUsers }}
{{- end }}
{{- if and (semverCompare ">=1.33-0" .Capabilities.KubeVersion.Version) (not (empty .Values.hostUsers)) }}
hostUsers: {{ ternary "true" "false" .Values.hostUsers }}
{{- end }}

This would skip rendering when the key is missing or explicitly nil, it would not silently fail when the key has any value, but it would still enforce the value of the flag to hold a boolean value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dacamposol, I see, this makes a lot of sense, i applied this recommendation

Copy link
Contributor

@zanhsieh zanhsieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KyriosGN0 Can you bump the chart version plz?

@KyriosGN0
Copy link
Contributor Author

@KyriosGN0 Can you bump the chart version plz?

@zanhsieh i did bump the chart's version to 6.5.0

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.

5 participants