charts icon indicating copy to clipboard operation
charts copied to clipboard

[bitnami/redis] schema breaks templating

Open Stevenpc3 opened this issue 1 year ago • 6 comments

Name and Version

bitnami/redis 20.2.1

What architecture are you using?

amd64

What steps will reproduce the bug?

In any environment, set a master.podAnnotations to a template value and see this error.

{32BC5C28-BEF5-48B3-8E37-364B14C5E6E5}

Are you using any custom parameters or values?

redis:
  master:
    podAnnotations: '{{- include "mysite.com/common/annotations" . }}'

What is the expected behavior?

deploys normally and templates the annotations as it used to do.

What do you see instead?

error from schema that says "string" is not valid and only accepts objects.

Additional information

This has been the way we have done it forever. In order to fix this I would have to pass keys and only render the values. We return a large set of key/value pairs and this breaks our functionality.

Stevenpc3 avatar Oct 16 '24 18:10 Stevenpc3

simply updating https://github.com/bitnami/charts/blob/main/bitnami/redis/values.schema.json#L590C18-L590C32 and https://github.com/bitnami/charts/blob/main/bitnami/redis/values.schema.json#L1309 (I think are the two places) to allow 'string' or 'object' should be enough.

Stevenpc3 avatar Oct 16 '24 18:10 Stevenpc3

I also assume many other places will have this issue like 'podLabels', 'affinity', 'nodeSelectors'... a whole bunch. Essentially, any item in values.yaml that is templatable, but the schema limits to objects or boolean or array or anything not a string.

Stevenpc3 avatar Oct 16 '24 18:10 Stevenpc3

Is there a way to make helm check the schema AFTER render? I would expect it to work that way which would resolve this issue...

Stevenpc3 avatar Oct 16 '24 18:10 Stevenpc3

Luckily for now I found a work around. It appears that metrics.podAnnoations applies annotations to the same application.yaml https://github.com/bitnami/charts/blob/858b84ec9bc20f2775e01dbfe05d2eb190579f21/bitnami/redis/templates/master/application.yaml#L57 but is not blocked by schema. I just have to also enable metrics for it to apply.

Stevenpc3 avatar Oct 16 '24 18:10 Stevenpc3

Hi!

Thank you so much for reporting. I believe there were other PRs in the past changing the schema to allow both types of values. Would you like to submit a PR updating the schema?

javsalgar avatar Oct 17 '24 07:10 javsalgar

What happened to those other PRs?

I can submit for the items that effect me now, but I don't have the time to go through all the other possible values that can be templates at this time.

Stevenpc3 avatar Oct 17 '24 11:10 Stevenpc3

This Issue 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. Thanks for the feedback.

github-actions[bot] avatar Nov 02 '24 01:11 github-actions[bot]

Bump to self

Stevenpc3 avatar Nov 02 '24 01:11 Stevenpc3

This Issue 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. Thanks for the feedback.

github-actions[bot] avatar Nov 18 '24 01:11 github-actions[bot]

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

github-actions[bot] avatar Nov 24 '24 01:11 github-actions[bot]