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

fix(operator): feature gates map allows add empty items #1463

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

marcelaraujo
Copy link

When you have a feature flag with the value defined as false, the rendered string will contain a empty comma and this triggers a failure in the operator.

manager:
  featureGatesMap:
    asdsadsa.adsads1: true
    asdsadsa.adsads2: false
    asdsadsa.adsads3: true
output:
- --feature-gates=asdsadsa.adsads1,,asdsadsa.adsads3

An example in the Helm playground.

@marcelaraujo marcelaraujo requested review from Allex1 and a team as code owners December 12, 2024 16:52
Copy link

linux-foundation-easycla bot commented Dec 12, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: marcelaraujo / name: Marcel Araujo (48af431, 4627e93)
  • ✅ login: TylerHelmuth / name: Tyler Helmuth (ed6793e)

Comment on lines +164 to +165
{{- if $v -}}
{{- $list = append $list (printf "%s=true" $k) -}}
Copy link
Member

Choose a reason for hiding this comment

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

If someone explicitly set asdsadsa.adsads2: false we should disable that feature gate. Let's add an else case to set -asdsadsa.adsads2

Comment on lines +164 to +165
{{- if $v -}}
{{- $list = append $list (printf "%s=true" $k) -}}
Copy link
Member

Choose a reason for hiding this comment

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

Feature gates are not enabled with =true. If the value is true the key should be added to the list, but nothing additional is needed.

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 this pull request may close these issues.

2 participants