Skip to content

Consider deprecating getSecondaryResource(Class,name) method from Context #1240

Closed
@csviri

Description

@csviri

(And removing in next major release.)

https://github.com/java-operator-sdk/java-operator-sdk/blob/58d2ea32cad4144aa63e3836e616a23c2fa911f0/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Context.java#L19-L21

Pros:

  1. we anyway have now <T> Set<T> getSecondaryResources(Class<T> expectedType); which return all the resource from all the related event sources of that type.
  2. We should move users to use just one event source per type, since it's more efficient.
  3. The event sources and resource cached are now tightly coupled, but this is not necessarily a good thing, might event change in the future. So ideally this interface should not know about the event sources and their names (what we might not even need then in the future)
  4. We could remove the quite complex code related to this logic:

https://github.com/java-operator-sdk/java-operator-sdk/blob/58d2ea32cad4144aa63e3836e616a23c2fa911f0/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/EventSources.java#L100-L140

Const:

  1. this still might be useful to distinguish or make it easier to find a cached resource.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions