Closed coltmcnealy-lh closed 6 months ago
Hi @coltmcnealy-lh thx for the bug report, will have to take a look how to solves this in a generic way. If you could provide an a simplified project to reproduce would help a lot. Until switching from to a non-ssa update (maybe would need a custom matcher, but not sure) would fix this. (Note that in the upcoming release ssa handling is switchable off per dependent resource)
Thanks @csviri. I am traveling this week so I will create a minimal reproducible example (istioctl
and kind
as dependencies) on Saturday morning.
@csviri I think this may actually be a layer-8 issue. I over-wrote this method:
public Result<Pod> match(Pod actualResource, Pod desired, LHCluster lhc, Context<LHCluster> ctx) {}
For various reasons, we have to store the "last-applied spec" in the annotations. I just compared the annotations in actualResource and desired. Now things appear to work as expected.
I also put together a simple example in my own github that just creates a simple hello-world NGINX pod. That one actually worked just fine. But it didn't have the crazy annotation-based processing (we do this internally because we needed to do a rolling restart and smooth scaledown without using a statefulset or similar).
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This issue was closed because it has been stalled for 14 days with no activity.
Bug Report
Reconciling a
Pod
with aCRUDKubernetesDependentResource
yields a 409 after sidecar injection via MutatingAdmissionWebhook.What did you do?
Our operator deals with
Pod
s manually through aCRUDKubernetesDependentResource
(bulk dependent, to be precise). We are testing in an Istio-enabled cluster which injects a sidecar into the pod through an admission webhook.What did you expect to see?
I expected to see the operator create the pod, the sidecar get injected, and then since I didn't change any spec on the pod itself in the
desiredResources()
method, future reconciliation loops should not try to remove any containers.What did you see instead? Under which circumstances?
We saw a
409
error because the JOSDK tried to apply the spec we provided without the injected sidecar container and init container. The stacktrace is shown below.Environment
KIND cluster, JOSDK
4.4.+
.