Skip to content

All Event Source Should Handle Multiple Secondary Resource for a Primary #1162

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

Closed
csviri opened this issue Apr 15, 2022 · 0 comments · Fixed by #1169
Closed

All Event Source Should Handle Multiple Secondary Resource for a Primary #1162

csviri opened this issue Apr 15, 2022 · 0 comments · Fixed by #1169
Assignees
Labels
architecture needs-discussion Issue needs to be discussed more before working on it

Comments

@csviri
Copy link
Collaborator

csviri commented Apr 15, 2022

Currently Context.getSecondaryResource() returns only one optional resource. This is done from the cache of an event source. (Note that ideally there is only one event source for one type of resource.) But a reconciler could manage multiple resources of a same type. For example manage multiple Deployment for a custom resource.

So we should probably add Context.getSecondaryResources() (plural) that returns a list. See this handled in this PR:
#1161

We should probably extend this to all event source, so from the mentioned PR to have all ResourceEventSource implement MultiResouceOwners. Since this is generally a something can occur with any resources.

For dependent resource, since one dependent resource always represents one resource not multiple, there would be a discriminator mechanism to distinguish to which resource it belongs to among related resources.

@csviri csviri added needs-discussion Issue needs to be discussed more before working on it architecture labels Apr 15, 2022
@csviri csviri self-assigned this Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture needs-discussion Issue needs to be discussed more before working on it
Projects
None yet
1 participant