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 feature flag to opt-into injection per pod #908

Merged
merged 4 commits into from
Jul 11, 2022

Conversation

StefanHauth
Copy link
Collaborator

@StefanHauth StefanHauth commented Jun 29, 2022

Description

Added feature flag feature.dynatrace.com/automatic-injection to disable automatic injection for a dynakube. If set to false, pods nominated for injection need to be manually annotated with oneagent.dynatrace.com/inject=true. Default value for the feature flag is true.

How can this be tested?

  • Set the annotation feature.dynatrace.com/automatic-injection: "false" on a dynakube
  • Create a pod or restart one in a namespace that is associated with the used dynakube
  • Check that there is no injection happening on the pod.
  • Add the annotation oneagent.dynatrace.com/inject: "true" to the pod spec and make sure the pod restarts
  • Check that there is injection happening on the pod.

Checklist

  • Unit tests have been updated/added
  • PR is labeled accordingly
  • I have read and understood the contribution guidelines

@StefanHauth StefanHauth self-assigned this Jun 29, 2022
@luhi-DT luhi-DT added the core Changes to core functionality of the Operator label Jun 29, 2022
@StefanHauth StefanHauth marked this pull request as ready for review June 30, 2022 07:58
@StefanHauth StefanHauth requested a review from a team as a code owner June 30, 2022 07:58
@chrismuellner chrismuellner changed the title Single pod opt in feature flag Add feature flag to opt-into injection per pod Jun 30, 2022
src/api/v1beta1/feature_flags.go Outdated Show resolved Hide resolved
src/mapper/mapper.go Outdated Show resolved Hide resolved
src/mapper/mapper.go Show resolved Hide resolved
src/mapper/namespaces.go Outdated Show resolved Hide resolved
src/webhook/mutation/pod_mutator/init_container.go Outdated Show resolved Hide resolved
src/webhook/mutation/pod_mutator/pod_mutator.go Outdated Show resolved Hide resolved
@meik99
Copy link
Contributor

meik99 commented Jun 30, 2022

for the linter, run make go/fmt go/lint to format and lint the file automatically

@0sewa0 0sewa0 enabled auto-merge (squash) July 11, 2022 07:51
@0sewa0 0sewa0 merged commit 56b4cf8 into master Jul 11, 2022
@0sewa0 0sewa0 deleted the SinglePodOptInFeatureFlag branch July 11, 2022 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Changes to core functionality of the Operator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants