Skip to content

[oadp-1.6] fix: check errors.IsNotFound before failing DaemonSet delete in NodeAgent reconcile - #2374

Open
kaovilai wants to merge 1 commit into
openshift:oadp-1.6from
kaovilai:fix-nodeagent-daemonset-notfound-1.6
Open

[oadp-1.6] fix: check errors.IsNotFound before failing DaemonSet delete in NodeAgent reconcile#2374
kaovilai wants to merge 1 commit into
openshift:oadp-1.6from
kaovilai:fix-nodeagent-daemonset-notfound-1.6

Conversation

@kaovilai

Copy link
Copy Markdown
Member

Summary

The DaemonSet deletion path in ReconcileNodeAgentDaemonset didn't check errors.IsNotFound(err) before treating a delete failure as a real error — unlike the adjacent Get() call and the ConfigMap deletion path in the same file, which both handle this correctly.

if err := r.Delete(deleteContext, ds, &client.DeleteOptions{...}); err != nil {
    if errors.IsNotFound(err) {
        return true, nil
    }
    r.EventRecorder.Event(ds, corev1.EventTypeNormal, "DeleteDaemonSetFailed", "...")
    return false, err
}

How this was found

Surfaced by this repo's own e2e log-analysis tooling on ci/prow/4.23-e2e-test-aws for PR #2206 (this branch, oadp-1.6): the AfterEach cleanup of "Configuration testing for DPA Custom Resource" hit a DeleteDaemonSetFailed event while the velero pod was stuck PodInitializing. Confirmed to be a pre-existing bug present across oadp-dev/oadp-1.6/oadp-1.5/oadp-1.4 (tracked via #2372 for all four branches; #2373 addresses oadp-dev, this PR addresses oadp-1.6).

Test plan

  • gofmt -l clean
  • go build ./internal/controller/...
  • go vet ./internal/controller/...

Part of #2372

Note

Responses generated with Claude

…gent reconcile

The DaemonSet deletion path in ReconcileNodeAgentDaemonset did not check
errors.IsNotFound before treating a delete failure as a real error,
unlike the adjacent Get() call and the ConfigMap deletion path in the
same file, which both handle this correctly.

Surfaced by e2e test flakiness where DeleteDaemonSetFailed events left
the AfterEach cleanup for DPA configuration tests in a bad state.

Part of openshift#2372

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: af6fa594-12b7-4863-9efb-8bad5ad7a52a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kaovilai

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2026
@openshift-ci

openshift-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown

@kaovilai: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/4.22-e2e-test-cli-aws 182d32c link true /test 4.22-e2e-test-cli-aws

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant