Skip to content

fix: requeue at dependency interval for missing object refs - #1577

Open
Bisman-Singh wants to merge 2 commits into
fluxcd:mainfrom
Bisman-Singh:fix/requeue-missing-refs-at-dependency-interval
Open

fix: requeue at dependency interval for missing object refs#1577
Bisman-Singh wants to merge 2 commits into
fluxcd:mainfrom
Bisman-Singh:fix/requeue-missing-refs-at-dependency-interval

Conversation

@Bisman-Singh

Copy link
Copy Markdown

Part of fluxcd/flux2#5809

When the Source object referenced by a HelmRelease (chartRef or the HelmChart from status) or a non-optional valuesFrom ConfigMap/Secret does not exist yet, the controller returned the raw error, putting the object on controller-runtime exponential backoff. This is inconsistent with how not ready dependencies, not ready sources and missing artifact files are handled, all of which requeue at the --requeue-dependency interval, and it delays bootstrap ordering when the referenced objects are created shortly after the HelmRelease (e.g. via a ResourceSet).

This change routes the two not-found paths through the existing errWaitForDependency handling:

  • getSource returning a NotFound error now requeues at --requeue-dependency (Ready=False with ArtifactFailedReason is still recorded).
  • chartutil.ChartValuesFromReferences failing with ErrResourceNotFound now requeues at --requeue-dependency (Ready=False with ValuesError and the warning event are still recorded).

Other errors on these paths (ACL denied, key-not-found in an existing values reference, transient API errors) keep their current behavior.

Tests: new waits for HelmChart to exist and waits for values reference to exist subtests plus an updated handles ChartRef get failure subtest assert the dependency-interval requeue; negative-path subtests pin generic Get errors and key-not-found to the backoff path. All were verified to fail against the unfixed code.

Signed-off-by: Bisman-Singh bismanmadaan1@gmail.com

When the Source object referenced by a HelmRelease or a non-optional
valuesFrom ConfigMap/Secret does not exist yet, requeue at the
--requeue-dependency interval instead of retrying with exponential
backoff. This is consistent with how not ready dependencies and
sources are already handled, and speeds up bootstrap ordering when
the referenced objects are created shortly after the HelmRelease.

Part of fluxcd/flux2#5809

Signed-off-by: Bisman-Singh <bismanmadaan1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant