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 reconcilers to add watches dynamically #542

Merged
merged 1 commit into from
Aug 5, 2019

Conversation

ncdc
Copy link
Contributor

@ncdc ncdc commented Jul 26, 2019

Allow reconcilers to add watches dynamically by getting a handle to the controller created by the builder via Build (changes the signature of Build).

Fixes #540

@k8s-ci-robot
Copy link
Contributor

Welcome @ncdc!

It looks like this is your first PR to kubernetes-sigs/controller-runtime 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/controller-runtime has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 26, 2019
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/lgtm
/assign @DirectXMan12

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 26, 2019
@DirectXMan12
Copy link
Contributor

replied a bit on the linked issue.

@DirectXMan12
Copy link
Contributor

/hold

(see the linked issue)

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 27, 2019
@ncdc
Copy link
Contributor Author

ncdc commented Jul 30, 2019

@DirectXMan12 I've pushed up the changes we discussed yesterday. For the time being, I've kept in my original injector commit along with another commit that reverts it (just in case we decided to go back to it 😄). Once you're happy with the new changes, I'll rebase and remove the injector commits.

@vincepri
Copy link
Member

LGTM

@@ -138,26 +135,24 @@ func (blder *Builder) Named(name string) *Builder {
// Complete builds the Application ControllerManagedBy.
func (blder *Builder) Complete(r reconcile.Reconciler) error {
_, err := blder.Build(r)
return err
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

This change isn't necessary. The error is already being handled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted

@DirectXMan12
Copy link
Contributor

can you just drop the WithManager and SimpleApplication (both of which are deprecated)? If that's too much putzing with the tests, I can push an additional commit to do it.

otherwise LGTM

Return controller from builder.Build to allow developers to use it after
it's been created by the builder; e.g., to add watches dynamically from
a reconciler.

Remove deprecated SimpleController() and Builder.WithManager().

Signed-off-by: Andy Goldstein <goldsteina@vmware.com>
@ncdc
Copy link
Contributor Author

ncdc commented Jul 31, 2019

@DirectXMan12 I removed WithManager and SimpleController. PTAL.

@DirectXMan12
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 5, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DirectXMan12, ncdc

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 5, 2019
@DirectXMan12 DirectXMan12 changed the title ✨ Allow reconcilers to add watches dynamically ⚠️ Allow reconcilers to add watches dynamically Aug 5, 2019
@DirectXMan12
Copy link
Contributor

(added :warning: since this is now breaking)

@DirectXMan12
Copy link
Contributor

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 5, 2019
@k8s-ci-robot k8s-ci-robot merged commit dc83571 into kubernetes-sigs:master Aug 5, 2019
DirectXMan12 pushed a commit that referenced this pull request Jan 31, 2020
🐛 report error if GOPATH env is missing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support adding new watches dynamically at runtime
5 participants