Closed lindhe closed 8 months ago
it's good idea, I like it and have an improvement.
With invenio as subchart we need to set a global.timezone in main chart. It's prone to errors.
value: {{ .Values.invenio.timezone | default "Europe/Zurich" | quote }}
invenio.timezone may be better location as it may be referenced in main chart or subchart.
And with a default value you can omit setting without error.
[…] It's prone to errors. […] And with a default value you can omit setting without error.
I agree, we should 100% handle the case when the timezone is unset! Very sloppy of me to not handle that in my original PR, sorry.
I usually prefer using required
rather than default
. That forces the user to be explicit with their values. It is easier to document; just look in the values.yaml
to see what the default value is, rather than 10 different places, which works well with tools like Readme Generator For Helm. Also, I find that using the default
function introduces implicit values which may be harder to understand and debug for the end user than the values they are forced to set explicitly. Do you agree?
invenio.timezone may be better location as it may be referenced in main chart or subchart.
Unless I misunderstand what you mean, it is absolutely possible to set global.timezone
even when Invenio is included as a subchart! Like this, if I recall correctly:
Chart.yaml
apiVersion: v2
name: foo
description: An umbrella chart that includes subcharts.
dependencies:
- name: invenio
version: "1.2.3"
repository: "https://example.com/charts"
values.yaml
invenio:
global:
timezone: Europe/Stockholm
yes, required is better. definitely.
I'm sorry, i wasn;t accurate with global
You have .Values.global.timezone
in your commit. It is use of helm builtin .Values.global
.Values.invenio.global.timezone
in your example, It is subkey of invenio definitions.
but both are good option
I've made the value required now. Do you want me to also drop the global
object or not?
A:
# values.yaml
global:
timezone: "Europe/Zurich"
B:
# values.yaml
timezone: "Europe/Zurich"
Do you want (A) or (B)?
global object should be better for chart with subcharts.
thanks.
A variant.
A variant?
yes, "A" variant
Ahaaa, right! Thanks, I get it now. Thought you meant "a variant" and I did not get it at all. 😄
I think it's already the (A) variant. So all good?
yes. :-)
Description
This change parameterizes the timezone variable used across deployments. The new value is
global.timezone
, following Bitnamis pattern of having aglobals
object for values that are used across multiple components.Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Third-party code
If you've added third-party code (copy/pasted or new dependencies), please reach out to an architect.
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: