-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make sure we pass the live config to the conversion webhook #6450
Conversation
This makes sure we pass the "live" configuration to the conversion webhook. Without this, that controller doesn't see any changes on the `feature-flags` configmap, and thus only uses the default value. This is a relatively big problem if some part of the conversion depends on it (which was the case for `embedded-status` for example) as it would cause loss of data. Signed-off-by: Vincent Demeester <[email protected]>
/cherry-pick release-v0.44.x |
@vdemeester: once the present PR merges, I will cherry-pick it on top of release-v0.44.x in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherry-pick release-v0.41.x |
@vdemeester: once the present PR merges, I will cherry-pick it on top of release-v0.41.x in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
We may as well backport this to 0.45 and 0.46 to be honest 👼🏼 |
/cherry-pick release-v0.45.x |
@vdemeester: once the present PR merges, I will cherry-pick it on top of release-v0.45.x in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherry-pick release-v0.46.x |
@vdemeester: once the present PR merges, I will cherry-pick it on top of release-v0.46.x in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test check-pr-has-kind-label |
@vdemeester: The specified target(s) for
The following commands are available to trigger optional jobs:
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the speedy catch @vdemeester
@@ -158,6 +158,9 @@ func newConversionController(ctx context.Context, cmw configmap.Watcher) *contro | |||
resolutionv1alpha1GroupVersion = resolutionv1alpha1.SchemeGroupVersion.Version | |||
resolutionv1beta1GroupVersion = resolutionv1beta1.SchemeGroupVersion.Version | |||
) | |||
// Decorate contexts with the current state of the config. | |||
store := defaultconfig.NewStore(logging.FromContext(ctx).Named("config-store")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you know why in the other controllers, store.WatchConfigs
is called within the inner function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you know why in the other controllers,
store.WatchConfigs
is called within the inner function?
Ah, that's a good point, I don't know, but it should be the same for all at least 😛 So I can move it there. It works in both cases, not sure what is the reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because of the difference in the outer function definitions.
Note newValidationAdmissionController
takes in a parameter of type string
and returns func
which has two parameters (Context
, Watcher
) and returns controller.Impl
whereas newConversionController
takes two parameters (Context
, Watcher
) and returns controller.Impl
.
func newValidationAdmissionController(name string) func(context.Context, configmap.Watcher) *controller.Impl { ... }
func newConversionController(ctx context.Context, cmw configmap.Watcher) *controller.Impl { ... }
Does it make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pritidesai I think it does 😝
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JeromeJu, lbernick The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
@vdemeester: new pull request created: #6460 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@vdemeester: new pull request created: #6461 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@vdemeester: new pull request created: #6462 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@vdemeester: new pull request created: #6464 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Changes
This makes sure we pass the "live" configuration to the conversion webhook. Without this, that controller doesn't see any changes on the
feature-flags
configmap, and thus only uses the default value.This is a relatively big problem if some part of the conversion depends on it (which was the case for
embedded-status
for example) as it would cause loss of data.Fixes #6443
Fixes possibly other "weird" behavior we've seen in the past or present (like #5964).
As this has been there for as long as we had conversion webhook, we need backport this to all supported LTS at least (0.44.0 and 0.41.0).
/kind bug
/cc @JeromeJu @lbernick @tektoncd/core-maintainers
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes