Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,16 @@ public Set<ResourceID> toPrimaryResourceIDs(HasMetadata resource) {
return Mappers.fromDefaultAnnotations(primaryResourceType).toPrimaryResourceIDs(resource);
}
}

/**
* The purpose of this mapper is to cover the cover case, when you don't want to be notified about
* changes of a resource. For example, it is read-only, and not expected to be changed. Note that
* having this you won't be able to access the resource through {@link
* io.javaoperatorsdk.operator.api.reconciler.Context#getSecondaryResources(Class)} only directly
* from event source like by {@link InformerEventSource#get(ResourceID)}. Use this with caution
* since usually this is not something that you require from an event source.
*/
public static <T> SecondaryToPrimaryMapper<T> voidSecondaryToPrimaryMapper() {
return resource -> Set.of();
}
}