Skip to content

Commit

Permalink
standlone generic k8s resource
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Mészáros <[email protected]>
  • Loading branch information
csviri committed May 22, 2024
1 parent 6d4fd6e commit a88fa5e
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ protected InformerEventSource<R, P> createEventSource(EventSourceContext<P> cont
&& kubernetesDependentResourceConfig.informerConfiguration() != null) {
config = kubernetesDependentResourceConfig.informerConfiguration();
} else {
config = InformerConfiguration.from(resourceType(), getPrimaryResourceType())

config = informerConfigurationBuilder()
.withSecondaryToPrimaryMapper(getSecondaryToPrimaryMapper().orElseThrow())
.build();
}
Expand All @@ -240,6 +241,13 @@ protected InformerEventSource<R, P> createEventSource(EventSourceContext<P> cont
return eventSource().orElseThrow();
}

/**
* To handle {@link io.fabric8.kubernetes.api.model.GenericKubernetesResource} based dependents.
*/
protected InformerConfiguration.InformerConfigurationBuilder<R> informerConfigurationBuilder() {
return InformerConfiguration.from(resourceType(), getPrimaryResourceType());
}

private boolean useNonOwnerRefBasedSecondaryToPrimaryMapping() {
return !garbageCollected && isCreatable();
}
Expand Down

0 comments on commit a88fa5e

Please sign in to comment.