diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ResourceOperations.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ResourceOperations.java index fdbac2db17..c4532aa284 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ResourceOperations.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ResourceOperations.java @@ -99,6 +99,15 @@ * from the desired one, thus also reducing the number of requests made against the Kubernetes API * server. * + *

Matching against cached resources. When matching the actual resource (in most + * cases read from the cache) against the desired one for secondary resources, the matching must be + * done on a cloned version of the actual resource. Secondary resources are not cloned by + * default when read from the cache (see {@link + * io.javaoperatorsdk.operator.api.config.ConfigurationService#cloneSecondaryResourcesWhenGettingFromCache()}), + * so mutating the resource obtained from the cache while matching would also mutate the copy stored + * in the cache. Either clone the resource explicitly before matching, or enable {@link + * io.javaoperatorsdk.operator.api.config.ConfigurationService#cloneSecondaryResourcesWhenGettingFromCache()}. + * * @param

the primary resource type on which this object operates */ public class ResourceOperations

{