Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forcing the param namespaces to be a default empty string #276

Conversation

falcon-pioupiou
Copy link
Contributor

if not forced to empty string, helm is taking the variable as an interface{}

without the default value :

Error: template: falcon-sensor/templates/container_secret.yaml:15:30: executing "falcon-sensor/templates/container_secret.yaml" at <.Values.container.image.pullSecrets.namespaces>: wrong type for value; expected string; got interface {}
helm.go:84: [debug] template: falcon-sensor/templates/container_secret.yaml:15:30: executing "falcon-sensor/templates/container_secret.yaml" at <.Values.container.image.pullSecrets.namespaces>: wrong type for value; expected string; got interface {}

if not forced to empty string, helm is taking the variable as an interface{}
@@ -188,7 +188,7 @@ container:
# list. For example:
#
# namespaces: ns1,ns2,ns3
namespaces:
namespaces: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

This works. Could also set the following in helm-charts/falcon-sensor/templates/container_secret.yaml on line 15 that may or may not be better:

{{- $myns := split "," (.Values.container.image.pullSecrets.namespaces | default "") -}}

Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would go on the values.yaml file as other tools (like argocd) are reading the values.yaml to build a UI didn't checked if it's decoding well or not on argocd but I'm fine with the default.

I think it's a helm issue so could impact other tools reading the values.yaml without looking at the schema.

Copy link
Contributor

Choose a reason for hiding this comment

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

{{- $myns := split "," (.Values.container.image.pullSecrets.namespaces | default "") -}} should also solve your problem since the schema value and validation is null or string which means it can handle both and not error out. Schema validation will need to be fixed as well to be string only if pursuing updating the in-chart values.yaml file.

@redhatrises redhatrises force-pushed the fix-falcon-container-allNamespaces-param branch from 0ae62ba to 902f9df Compare April 29, 2024 16:37
@redhatrises redhatrises merged commit 22829f7 into CrowdStrike:main Apr 29, 2024
1 check passed
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.

2 participants