We could avoid that dry run request by implementing a cache holding extracted state for a given desired state (e.g. spec.forProvidder.manifest), very roughly:
Get the object from controller runtime cache.
Extract state using applymetav1.UnstructuredExtractor.
Get the cached extracted state for the current desired state (spec.forProvidder.manifest).
What problem are you facing?
https://github.com/crossplane-contrib/provider-kubernetes/pull/246 introduces support for SSA (server side apply) as an alpha feature. It includes a workaround for https://github.com/kubernetes/kubernetes/issues/115563 which utilizes a dry run request to decide whether the resources is in the desired state or not. This will be executed in each reconciliation, in the
Observe
method.How could Crossplane help solve your problem?
We could avoid that dry run request by implementing a cache holding extracted state for a given desired state (e.g.
spec.forProvidder.manifest
), very roughly:applymetav1.UnstructuredExtractor
.spec.forProvidder.manifest
).