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

Channel Source is borked due to stop channel injection #103

Closed
DirectXMan12 opened this issue Aug 6, 2018 · 3 comments · Fixed by #204
Closed

Channel Source is borked due to stop channel injection #103

DirectXMan12 opened this issue Aug 6, 2018 · 3 comments · Fixed by #204

Comments

@DirectXMan12
Copy link
Contributor

The Channel source expects the stop channel to be injected before calling Start, but the stop channel on the controller manager will be nil until ControllerManager#Start is called. Since most people will probably call Controller#Watch before ControllerManager#Start, this breaks the channel source.

I've got a patch to fix it in the works, but wanted to file this so that I don't forget.

@AMecea
Copy link

AMecea commented Aug 23, 2018

@DirectXMan12 any news about this?

@DirectXMan12
Copy link
Contributor Author

no, unfortunately I became busy with some other stuff, and it's going to take a bit of thinking about how to refactor the internals to make it work. I'll take another stab at it next week.

@hzamani
Copy link

hzamani commented Sep 5, 2018

One solution is to add a Initialize method to Reconciler interface and call that in Controller#Start, then move all Controller#Watch calls to this method. This method can be used for other initialization stuff that require ControllerManager to be started (for example operations that require a synced catch).

mhrivnak added a commit to mhrivnak/controller-runtime that referenced this issue Sep 19, 2018
mhrivnak added a commit to mhrivnak/controller-runtime that referenced this issue Sep 19, 2018
mhrivnak added a commit to mhrivnak/controller-runtime that referenced this issue Sep 19, 2018
mhrivnak added a commit to mhrivnak/controller-runtime that referenced this issue Sep 19, 2018
fixes kubernetes-sigs#103

Creates a stop channel for the manager in New(), which will get passed to any
source.Channel instances that are added. When the manager's start method is
called and a new stop channel is passed in, that channel will be joined in a
goroutine with the manager's existing channel so that if the newer channel gets
closed, so will the manager's.
mhrivnak added a commit to mhrivnak/controller-runtime that referenced this issue Sep 28, 2018
This is backward-incompatible. The manager accepts Context instead of a stop
channel, which helps simplify cancellation workflow and is more in line with
the direction related projects are moving.

This pattern can be expanded in a similar way to controllers, the cache, and
so on if people like it.

fixes kubernetes-sigs#103
DirectXMan12 pushed a commit to DirectXMan12/controller-runtime that referenced this issue Nov 9, 2018
fixes kubernetes-sigs#103

Creates a stop channel for the manager in New(), which will get passed to any
source.Channel instances that are added. When the manager's start method is
called and a new stop channel is passed in, that channel will be joined in a
goroutine with the manager's existing channel so that if the newer channel gets
closed, so will the manager's.
DirectXMan12 pushed a commit to DirectXMan12/controller-runtime that referenced this issue Nov 12, 2018
fixes kubernetes-sigs#103

Creates a stop channel for the manager in New(), which will get passed to any
source.Channel instances that are added. When the manager's start method is
called and a new stop channel is passed in, that channel will be joined in a
goroutine with the manager's existing channel so that if the newer channel gets
closed, so will the manager's.
justinsb pushed a commit to justinsb/controller-runtime that referenced this issue Dec 7, 2018
fixes kubernetes-sigs#103

Creates a stop channel for the manager in New(), which will get passed to any
source.Channel instances that are added. When the manager's start method is
called and a new stop channel is passed in, that channel will be joined in a
goroutine with the manager's existing channel so that if the newer channel gets
closed, so will the manager's.
DirectXMan12 pushed a commit that referenced this issue Jan 31, 2020
Bump cmd versions of kube dependencies to kubernetes-1.10.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants