-
Notifications
You must be signed in to change notification settings - Fork 544
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
Move typed queues to ResourceEvent over 'any' #3475
base: master
Are you sure you want to change the base?
Conversation
e1a5348
to
1c67076
Compare
event, ok := item.(kubestate.ResourceEvent) | ||
if !ok || event.Type() != kubestate.ResourceDeleted { | ||
var event = item | ||
if item.Type() != kubestate.ResourceDeleted { | ||
// Get the key |
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.
All this indirection on getting a key can probably be removed now that we know the item is a ResourceEvent.
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.
There's another nutty thing going on here (which I dared not touch). The queue items are in the form
EventResource{type, string} (with the exception of the delete event which carries the object), but the events that get sent to the Sync'ers are in the form EventResource{type, obj}.
So, initial intuition that the syncers worked over old/failed versions of the resources was wrong, because the current version gets picked up and injected here.
Or, did you already get that, and there's a better way to massage this that I'm not seeing?
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.
the reason why the delete event doesn't get the same treatment is: https://github.com/operator-framework/operator-lifecycle-manager/blob/master/pkg/lib/queueinformer/queueinformer.go#L40.
We may want to revisit this in a follow-up. But, for now, I feel there is sufficient change in this PR that we can let out into the wild before further refactoring.
1c67076
to
065fe04
Compare
Signed-off-by: Per Goncalves da Silva <[email protected]>
065fe04
to
4133943
Compare
Signed-off-by: Per Goncalves da Silva <[email protected]>
Description of the change:
This PR updates our usage of client-go work queues to be kubestate.ResourceEvent typed. Before the change, the queues would accept any comparable datatype, and we had different types flowing through the queues. For instance, for the namespace resolution queue, we had strings as well as ResourceEvents. Using the queue in this meant that we could (and had) the same resource being concurrently reconciled twice: for both the semantically identical string and ResourceEvent items. This in turn led to Subscriptions being put in a terminal UnSat state since the reconciliation that created the install plan (and subsequently the CSV) wasn't finished when the concurrent reconciliation for the same namespace resolved with a seemingly dissociated CSV (i.e. .status.CurrentCSV was empty, but the CSV had been stamped out).
Closes #3010
Motivation for the change:
Architectural changes:
Testing remarks:
Reviewer Checklist
/doc
[FLAKE]
are truly flaky and have an issue