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

Issue with boolean values as string in operator labels #548

Closed
Kavinraja-G opened this issue Jan 2, 2023 · 0 comments · Fixed by #549
Closed

Issue with boolean values as string in operator labels #548

Kavinraja-G opened this issue Jan 2, 2023 · 0 comments · Fixed by #549

Comments

@Kavinraja-G
Copy link
Contributor

Kavinraja-G commented Jan 2, 2023

Expected behaviour

Adding labels: {"someKey": "true"} to values.yaml should render the helm templates and install the operator

Actual behaviour

Looks like we are using range to construct the labels from values.yaml on fly. But range doesn't preserve the dataType of what we pass it seems. So it fails to render the values as string even if we pass "true" or "false" consider them as bool and results in the below error

unable to decode "": json: cannot unmarshal bool into Go struct field ObjectMeta.metadata.labels of type string

Note: Labels only support string dataType for keys & values

Workaround

Modify the range and use toYaml functions which converts the values to string type as well

Steps to reproduce the behaviour

Describe step by step what you've have done to get to this point

Environment

How are the pieces configured?

  • Redis Operator version - 3.2.5
  • Kubernetes version - 1.24
  • Kubernetes configuration used (eg: Is RBAC active?)

Logs

Please, add the debugging logs. In order to be able to gather them, add -debug flag when running the operator.

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 a pull request may close this issue.

1 participant