Skip to content

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

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:oadp-1.4from
kaovilai:fix-nodeagent-daemonset-notfound-1.4
Aug 13, 2026
Merged

[oadp-1.4] fix: check errors.IsNotFound before failing DaemonSet delete in NodeAgent reconcile#2376
openshift-merge-bot[bot] merged 1 commit into
openshift:oadp-1.4from
kaovilai:fix-nodeagent-daemonset-notfound-1.4

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 in the same function, which already handles 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 (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/#2374/#2375 address oadp-dev/oadp-1.6/oadp-1.5, this PR addresses oadp-1.4).

Test plan

  • gofmt -l clean
  • go build ./controllers/...
  • go vet ./controllers/...

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, which already handles 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: f3e858ef-cb67-48ca-bd2f-640dab825930

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.46%. Comparing base (1dfe2da) to head (22f8b1b).

⚠️ Current head 22f8b1b differs from pull request most recent head fd0ff4a

Please upload reports for the commit fd0ff4a to get more accurate results.

Files with missing lines Patch % Lines
controllers/nodeagent.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           oadp-1.4    #2376      +/-   ##
============================================
- Coverage     38.47%   38.46%   -0.01%     
============================================
  Files            30       30              
  Lines          5113     5114       +1     
============================================
  Hits           1967     1967              
- Misses         2949     2950       +1     
  Partials        197      197              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Joeavaikath, kaovilai, shubham-pampattiwar

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:
  • OWNERS [Joeavaikath,kaovilai,shubham-pampattiwar]

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

@kaovilai kaovilai added the lgtm Indicates that a PR is ready to be merged. label Aug 13, 2026
@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown

@kaovilai: all tests passed!

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.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 45a8cb9 into openshift:oadp-1.4 Aug 13, 2026
11 checks passed
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants