Skip to content

chore: replace deprecated ctrl.Result.Requeue with RequeueAfter - #11344

Merged
leonardoce merged 2 commits into
mainfrom
dev/requeue-deprecation
Aug 24, 2026
Merged

leonardoce merged 2 commits into
mainfrom
dev/requeue-deprecation

Conversation

@mnencia

@mnencia mnencia commented Aug 20, 2026

Copy link
Copy Markdown
Member

controller-runtime deprecated the Requeue field of ctrl.Result in favor of RequeueAfter, which golangci-lint's staticcheck (SA1019) now flags on every remaining use.

Replace every remaining Requeue: true with an equivalent RequeueAfter duration, matching the interval already used by neighboring call sites in the same function. Also restructure the unknown-plugin early return in ClusterReconciler.Reconcile, whose combined multi-line composite-literal-and-call return was toggling between two gofumpt-preferred indentations across successive lint runs.

@mnencia
mnencia requested a review from a team as a code owner August 20, 2026 06:50
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. chore Intangible work to reduce technical debt labels Aug 20, 2026
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.28 release-1.29 release-1.30 labels Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@mnencia
mnencia force-pushed the dev/requeue-deprecation branch from 95adbef to 5cb9f58 Compare August 20, 2026 06:50
@mnencia mnencia changed the title fix: replace deprecated ctrl.Result.Requeue with RequeueAfter chore: replace deprecated ctrl.Result.Requeue with RequeueAfter Aug 20, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 20, 2026
@mnencia

mnencia commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

/test

@github-actions

Copy link
Copy Markdown
Contributor

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Aug 20, 2026
controller-runtime deprecated the Requeue field of ctrl.Result in
favor of RequeueAfter, which golangci-lint's staticcheck (SA1019) now
flags on every remaining use.

Replace every remaining Requeue: true with an equivalent RequeueAfter
duration, matching the interval already used by neighboring call
sites in the same function. Also restructure the unknown-plugin early
return in ClusterReconciler.Reconcile, whose combined multi-line
composite-literal-and-call return was toggling between two
gofumpt-preferred indentations across successive lint runs.

Signed-off-by: Marco Nenciarini <[email protected]>
@mnencia
mnencia force-pushed the dev/requeue-deprecation branch from 5cb9f58 to 207e765 Compare August 21, 2026 18:18
Silence staticcheck SA1019 on intentional deprecated-field usage in
tests with per-line nolint directives, and apply gofumpt formatting
to two test-support files with redundant parentheses.

Signed-off-by: Marco Nenciarini <[email protected]>
@leonardoce
leonardoce merged commit 0643487 into main Aug 24, 2026
36 checks passed
@leonardoce
leonardoce deleted the dev/requeue-deprecation branch August 24, 2026 15:53
cnpg-bot pushed a commit that referenced this pull request Aug 24, 2026
controller-runtime deprecated the Requeue field of ctrl.Result in favor
of RequeueAfter, which golangci-lint's staticcheck (SA1019) now flags on
every remaining use.

Replace every remaining Requeue: true with an equivalent RequeueAfter
duration, matching the interval already used by neighboring call sites
in the same function. Also restructure the unknown-plugin early return
in ClusterReconciler.Reconcile, whose combined multi-line
composite-literal-and-call return was toggling between two
gofumpt-preferred indentations across successive lint runs.

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 0643487)
mnencia added a commit that referenced this pull request Aug 24, 2026
controller-runtime deprecated the Requeue field of ctrl.Result in favor
of RequeueAfter, which golangci-lint's staticcheck (SA1019) now flags on
every remaining use.

Replace every remaining Requeue: true with an equivalent RequeueAfter
duration, matching the interval already used by neighboring call sites
in the same function. Also restructure the unknown-plugin early return
in ClusterReconciler.Reconcile, whose combined multi-line
composite-literal-and-call return was toggling between two
gofumpt-preferred indentations across successive lint runs.

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 0643487)
mnencia added a commit that referenced this pull request Aug 24, 2026
controller-runtime deprecated the Requeue field of ctrl.Result in favor
of RequeueAfter, which golangci-lint's staticcheck (SA1019) now flags on
every remaining use.

Replace every remaining Requeue: true with an equivalent RequeueAfter
duration, matching the interval already used by neighboring call sites
in the same function. Also restructure the unknown-plugin early return
in ClusterReconciler.Reconcile, whose combined multi-line
composite-literal-and-call return was toggling between two
gofumpt-preferred indentations across successive lint runs.

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 0643487)
gbartolini pushed a commit that referenced this pull request Oct 17, 2026
Since #11344 replaced the deprecated `Requeue` field, a reconciler hook
returning `BEHAVIOR_REQUEUE` without `requeue_after` maps to an empty
`ctrl.Result`, so the Cluster is not requeued at all. `requeue_after` is
optional in CNPG-I, and the barman-cloud plugin returns no delay when
the referenced ObjectStore doesn't exist yet: a Cluster created before
its ObjectStore then stays in `BootstrapPending` until something else
triggers a reconciliation.

Requeue after one second when no delay is requested.

Closes #11618

Assisted-by: Claude

Signed-off-by: Valerio Del Sarto <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
cnpg-bot pushed a commit that referenced this pull request Oct 17, 2026
Since #11344 replaced the deprecated `Requeue` field, a reconciler hook
returning `BEHAVIOR_REQUEUE` without `requeue_after` maps to an empty
`ctrl.Result`, so the Cluster is not requeued at all. `requeue_after` is
optional in CNPG-I, and the barman-cloud plugin returns no delay when
the referenced ObjectStore doesn't exist yet: a Cluster created before
its ObjectStore then stays in `BootstrapPending` until something else
triggers a reconciliation.

Requeue after one second when no delay is requested.

Closes #11618

Assisted-by: Claude

Signed-off-by: Valerio Del Sarto <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 99e9645)
cnpg-bot pushed a commit that referenced this pull request Oct 17, 2026
Since #11344 replaced the deprecated `Requeue` field, a reconciler hook
returning `BEHAVIOR_REQUEUE` without `requeue_after` maps to an empty
`ctrl.Result`, so the Cluster is not requeued at all. `requeue_after` is
optional in CNPG-I, and the barman-cloud plugin returns no delay when
the referenced ObjectStore doesn't exist yet: a Cluster created before
its ObjectStore then stays in `BootstrapPending` until something else
triggers a reconciliation.

Requeue after one second when no delay is requested.

Closes #11618

Assisted-by: Claude

Signed-off-by: Valerio Del Sarto <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 99e9645)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases chore Intangible work to reduce technical debt lgtm This PR has been approved by a maintainer no-issue ok to merge 👌 This PR can be merged release-1.28 release-1.30 size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants