-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
[bitnami/common] [bitnami/wordpress] Use global.storageClass for fallback, not override #24863
base: main
Are you sure you want to change the base?
Conversation
b9b3ec7
to
e70dec0
Compare
This fixes bitnami#24845 as we now prefer the more specific option over the global option, rather than the other way around. Signed-off-by: James Tocknell <aragilar@gmail.com>
e70dec0
to
366f4dc
Compare
Let me know if there are any issues with this (or feel free to push any fixes). |
Hi @aragilar Thanks so much for this contribution! It's true that it'd be more convenient There's a reason though for this behavior: being consistent with other global values and their associated common helpers. To be more precise, to be aligned with However, it's true that they're different use cases since we're setting a default value for
|
Cool! I'm happy with Side note, I'm not sure how best (or how well) doing a transition would work, but if the current |
Hi @aragilar We should apply the change in the "common" library to expect Then, we'll have to create a PR per chart bumping the chart deps and applying the changes below (we can take part of this tedious part): index 176a0ae34..cbb11af5a 100644
--- a/bitnami/wordpress/values.yaml
+++ b/bitnami/wordpress/values.yaml
@@ -9,7 +9,7 @@
## @param global.imageRegistry Global Docker image registry
## @param global.imagePullSecrets Global Docker registry secret names as an array
-## @param global.storageClass Global StorageClass for Persistent Volume(s)
+## @param global.defaultStorageClass Global default StorageClass for Persistent Volume(s)
##
global:
imageRegistry: "" It also seems we'll have to pay special attention while adapting JupyterHub & Cassandra, see: |
global.storageClass remains as an override, not as a default. Signed-off-by: James Tocknell <aragilar@gmail.com>
c2234c6
to
bfc7008
Compare
@juan131 I think my new commit adds the right flow in terms of which values override each other, but I'd appreciate the second set of eyes. I'm happy to drop the first commit, or squash, or whatever is your preferred process (or feel free to make changes to the branch yourself). |
{{/* | ||
Uses https://stackoverflow.com/a/68807258/1306020 to avoid lots of ifs. | ||
This allows all storage classes to be overridden by .global.storageClass, and to | ||
fallback to .global.defaultStorageClass if no specific class was set. | ||
*/}} | ||
{{- $storageClass := (.global).storageClass | default .persistence.storageClass | default (.global).defaultStorageClass | default "" -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please correct me if I'm wrong but this will fail if global
object isn't defined since you're trying to access a "storageClass" property of a null
object.
Try with this:
{{/* | |
Uses https://stackoverflow.com/a/68807258/1306020 to avoid lots of ifs. | |
This allows all storage classes to be overridden by .global.storageClass, and to | |
fallback to .global.defaultStorageClass if no specific class was set. | |
*/}} | |
{{- $storageClass := (.global).storageClass | default .persistence.storageClass | default (.global).defaultStorageClass | default "" -}} | |
{{- $defaultStorageClass := ternary (default "" .global.storageClass) "" .global -}} | |
{{- $storageClass := default $defaultStorageClass .persistence.storageClass -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, got pulled on to other projects so this dropped down the my todo list. My understanding from the linked stackoverflow answer (though I'm very new to how the helm/go templating language works) is you can do (.maybe_null).also_maybe_null
and this won't error due to the extra parentheses? Happy to use your flow if you think it's better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're definitely right! Indeed, I love this syntax, I sent a PR to adopt it broadly in the common
library, see #25446
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution. |
Was there anything I needed to do for this/what are the next steps? |
Hi @aragilar Yes! Please ensure you merge the latest changes in the origin's |
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Pull Request. Do not hesitate to reopen it later if necessary. |
Signed-off-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
Description of the change
This fixes #24845 as we now prefer the more specific value over the global value, rather than the other way around.
Benefits
As above, this fixes #24845.
Possible drawbacks
Applicable issues
Additional information
Checklist
Chart.yaml
according to semver. This is not necessary when the changes only affect README.md files.README.md
using readme-generator-for-helm