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

Conditionally set container-suffix in ECK config #6711

Merged

Conversation

thbkrkr
Copy link
Contributor

@thbkrkr thbkrkr commented Apr 20, 2023

This commit ensures that the config.containerSuffix Helm value is not empty before writing it to the ECK configMap data to avoid the side effect of the configMap data being formatted on a single line.

I intentionally kept the PR scoped to the bug but we could extend this to all values used in the ECK config.

Resolves #6695.

@thbkrkr thbkrkr added the >bug Something isn't working label Apr 20, 2023
@thbkrkr thbkrkr changed the title Contidionaly set container-suffix in ECK config Conditionally set container-suffix in ECK config Apr 20, 2023
Copy link
Contributor

@naemono naemono left a comment

Choose a reason for hiding this comment

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

lgtm but with one question about consistency

container-suffix: {{ .Values.config.containerSuffix }}
{{- with .Values.config.containerSuffix }}
container-suffix: {{ . }}
{{- end }}
max-concurrent-reconciles: {{ int .Values.config.maxConcurrentReconciles }}
{{- if .Values.config.passwordHashCacheSize }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to change all of these if blocks to with blocks for consistency?

https://helm.sh/docs/chart_template_guide/control_structures/
the block after with only executes if the value of PIPELINE is not empty.

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 find the with syntax very nice for readability and figured it was worth starting to use it at the cost of a little break in consistency.

It would be nice to move all the if to with but this is a low hanging fruit: #6716.

@thbkrkr thbkrkr merged commit e22fbfd into elastic:main Apr 21, 2023
@thbkrkr thbkrkr added the v2.8.0 label Apr 24, 2023
@thbkrkr thbkrkr deleted the conditionaly-set-container-suffix-in-eck-config branch May 10, 2023 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v2.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eck.yaml outputs as single-line string since ECK v2.6
3 participants