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

Add structure for feature flags #6491

Merged
merged 1 commit into from May 17, 2024
Merged

Add structure for feature flags #6491

merged 1 commit into from May 17, 2024

Conversation

ArthurSens
Copy link
Member

Description

As discussed in the last office hours, we want to start to provide a few features behind feature flags. This PR introduces the concept, but still no feature flags are available.

They will be added as need in following PRs.

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.


@ArthurSens ArthurSens requested a review from a team as a code owner April 9, 2024 14:59
@ArthurSens ArthurSens force-pushed the feature-flags branch 2 times, most recently from 328f17a to 009ad19 Compare April 9, 2024 15:11
@simonpasquier
Copy link
Contributor

Should we implement something similar to https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#overview?
We could leverage https://pkg.go.dev/k8s.io/component-base/cli/flag#MapStringString for parsing the arguments.

@ArthurSens
Copy link
Member Author

I wasn't aware that k8s had a dedicated package for this :)

I tried playing with it a bit but I got confused about how we're supposed to register flags with it 🤔, do you have any examples at hand?

@simonpasquier
Copy link
Contributor

maybe check https://github.com/rhobs/observability-operator/blob/e09b23605cdfc824010a3934026136df1d15b031/cmd/operator/main.go#L81-L86
my first instinct would have been to mimic Kubernetes feature flags rather than Prometheus feature flags.

@ArthurSens
Copy link
Member Author

Gave it a try, let me know what you think :)

Signed-off-by: Arthur Silva Sens <arthur.sens@coralogix.com>
@ArthurSens
Copy link
Member Author

conflicts resolved!

@simonpasquier simonpasquier merged commit 49472c7 into main May 17, 2024
17 checks passed
@simonpasquier simonpasquier deleted the feature-flags branch May 17, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants