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

Allow default broker controller to reconcile unset brokerclass. #2761

Closed
wants to merge 1 commit into from

Conversation

liu-cong
Copy link
Contributor

@liu-cong liu-cong commented Mar 17, 2020

Proposed Changes

  • Allow the default broker controller to reconcile brokers without brokerclass annotation for backwards compatibility.

Depends on knative/pkg#1163.

Release Note

NONE

Docs

cc @vaikas

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 17, 2020
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 17, 2020
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 17, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: liu-cong
To complete the pull request process, please assign harwayne
You can assign the PR to them by writing /assign @harwayne in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/broker/controller.go 87.5% 88.9% 1.4

@knative-prow-robot
Copy link
Contributor

@liu-cong: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-knative-eventing-build-tests 60a7e50 link /test pull-knative-eventing-build-tests
pull-knative-eventing-unit-tests 60a7e50 link /test pull-knative-eventing-unit-tests
pull-knative-eventing-integration-tests 60a7e50 link /test pull-knative-eventing-integration-tests

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@n3wscott
Copy link
Contributor

It is too easy to get the function wrong. Best to not allow an unset broker class. Use the webhook to set a default.

@liu-cong
Copy link
Contributor Author

It is too easy to get the function wrong. Best to not allow an unset broker class. Use the webhook to set a default.

Yes we can use webhook for new brokers. However, for existing brokers without an annotation, the reconciler won't pick it up. I think we should make it backwards compatible to ensure a seamless upgrade.

cc @vaikas

@n3wscott
Copy link
Contributor

For existing brokers, the defaulting webhook from the conversion will handle them.

If we want seamless upgrades, we need an upgrade test first.

@liu-cong
Copy link
Contributor Author

liu-cong commented Mar 17, 2020

If we want seamless upgrades, we need an upgrade test first.

Yes agree we should have some upgrade tests. I don't think I will be able to add one this week but I will be interested to work on it.

For existing brokers, the defaulting webhook from the conversion will handle them.

What I noticed on my cluster is that the conversion seems to only work on client side, not server side. Although I can see the annotation being added by kubectl get, what the controller sees is still empty.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 27, 2020
@knative-prow-robot
Copy link
Contributor

@liu-cong: PR needs rebase.

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.

@liu-cong liu-cong marked this pull request as ready for review March 30, 2020 18:38
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 30, 2020
@liu-cong
Copy link
Contributor Author

The proper approach is probably to have an upgrade job that handles upgrades for all resources wherever applicable. However we don't have time to design and implement such an upgrade job before 0.14 freezes.

This approach is a quick fix for the issue.

@vaikas
Copy link
Contributor

vaikas commented Mar 30, 2020

Yes, proper conversion job would definitely be the proper fix. I do wonder however if in lieu of that work, we could just provide a script that's only going to update brokers because that seems very straightforward and won't have future package with it?
for each namespace
for each broker
apply a patch to add the annotation to ChannelBasedBroker

@liu-cong
Copy link
Contributor Author

we could just provide a script that's only going to update brokers

@vaikas Do you expect users to manually run this script?

@vaikas
Copy link
Contributor

vaikas commented Apr 1, 2020

Yes, that was my thinking. One time upgrade script.

@grantr
Copy link
Contributor

grantr commented Apr 6, 2020

It looks like this is made obsolete by #2910. @liu-cong should this be closed?

@liu-cong
Copy link
Contributor Author

liu-cong commented Apr 6, 2020

#2910

@liu-cong liu-cong closed this Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants