Closed grossws closed 1 year ago
Thx @grossws we will take a look on this soon.
@grossws since this use case is not supported now in 3.x but will be in 4.1 - that is going to be released hopefully next week - what I did is reproduced this based on the sample in this PR: https://github.com/java-operator-sdk/java-operator-sdk/pull/1581
it works flawlessly. hope Is it ok for you to upgrade to this version (the quarkus extension might come a little later).
(if not objections will close this issue for now)
Thanks for investigating, @csviri.
I hope Quarkus folks will integrate it soon after your release, they already have 5.0.0.Beta1 with Java Operator SDK 4.0.3
Bug Report
Reconciler with managed workflow and managed dependent resources with ready post-condition doesn't progress after reconciling first dependent resource.
Resource with
readyPostcondition
is reconciled successfully but condition based on secondary is never met since it receives the same secondary resource cached at time of its reconcilation.Tried it with both
WATCH_ALL_NAMESPACES
andWATCH_CURRENT_NAMESPACE
.What did you do?
Full reproducer: https://github.com/grossws/operatorsdk-es-issue
Managed dependent resources are discriminated based on
labelSelector
:What did you expect to see?
isMet
to eventually return true whenStatefulSet
sreadyReplicas
becomes 1.StatefulSet
reconciled and CR status updated based onWorkflowReconcileResult
.What did you see instead? Under which circumstances?
isMet
based on secondary resource status always returnsfalse
since it receives same cached secondary resource from the moment it was reconciled.StatefulSet
.Logs demonstrate that actual
StatefulSet
status is updated butsecondary
passed toisMet
is still the same:Environment
Additional context
I'm implementing an operator for a legacy system consisting of a bunch of both stateful and stateless microservices which requires strict startup order for some of them, so I tried workflow feature.
Just
dependsOn
is not enough since reconciler will start second dependent service reconcilation right after first one is reconciled (but not ready yet). ThusreadyPostcondition
.For several managed dependent resources of same type I used approach with discriminating them by label selector like
app.kubernetes.io/managed-by=...,app.kubernetes.io/component=...
where component is unique for the resource type among resources managed by this operator.See also: https://discord.com/channels/723455000604573736/780769121305493544/1032712459200503829