Closed fsommar closed 1 year ago
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
What happened:
When my
Preflight
check fails, I get a panic in theReconciled
implementation that I'm using (status.NewAggregator
). It panics on theobjs.Items
access. On a brief inspection, the same seems to hold true for all the otherReconciled
implementations too.What you expected to happen:
No panic, but at least log the error and try to recover.
How to reproduce it (as minimally and precisely as possible):
Create an implementation of
declarative.Preflight
that returns an error:In the reconciler setup, use
declarative.StatusBuilder
along with any of the built-inReconciled
implementations. Let's assumestatus.NewAggregator
:More details
The current implementation expects
manifest.Objects
to always be non-nil. What happens when thePreflight
check fails is that the deferred function in the reconciler callsReconciled
with nilobjects
, as that variable is only set after a successfulPreflight
check.I don't think there is any sense in omitting the
Reconciled
call altogether, so another option would be to have alldeclarative.Reconciled
implementations robust in the face of nilmanifest.Objects
. One could argue that the contract interface already dictates thatmanifest.Objects
can be nil. Or rather, any time the error parameter is passed, theReconciled
implementation should deal with it, either by returning early or executing a second code path.Workaround
We already have our own
Reconciled
implementation that delegates tostatus.NewAggregator
, so what we can do for now is return early from there and not call the delegate on error.