openshift / openshift/oadp-operator

nodeagent DaemonSet delete missing errors.IsNotFound check, causes DeleteDaemonSetFailed / test flakiness

Open Beginner friendly
#2,372 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
92
Forks
93
Avg merge
1d 23h
Merged PRs (30d)
43

Description

Bug

The node-agent DaemonSet deletion path doesn't check errors.IsNotFound(err) before treating a delete failure as a real error — unlike the adjacent ConfigMap deletion path in the same reconciler, which does handle this correctly.

// DaemonSet path (missing IsNotFound check):
if err := r.Delete(deleteContext, ds, &client.DeleteOptions{...}); err != nil {
    r.EventRecorder.Event(...)
    return false, err  // should treat IsNotFound as success (already gone)
}

Recommended fix: add errors.IsNotFound(err) handling after the r.Delete() call — when the delete fails with NotFound, treat it as success (the DaemonSet is already gone), matching the ConfigMap path's existing behavior.

Affected versions (confirmed present in all)

Branch File Line
oadp-dev internal/controller/nodeagent.go 278
oadp-1.6 internal/controller/nodeagent.go 278
oadp-1.5 internal/controller/nodeagent.go 214
oadp-1.4 controllers/nodeagent.go 152

How this was found

Surfaced by this repo's own automated e2e log-analysis tooling on ci/prow/4.23-e2e-test-aws for PR #2206 (oadp-1.6, unrelated change — veleroPredicate/annotation-change reconciliation): the AfterEach cleanup of "Configuration testing for DPA Custom Resource" (tests/e2e/dpa_deployment_suite_test.go) hit a DeleteDaemonSetFailed event while the velero pod was stuck PodInitializing, failing the test. The analysis explicitly concluded: "Likely Cause: Real bug in the OADP operator's DaemonSet reconciliation logic. Not a flake, not environmental." None of the known-flake patterns in tests/e2e/lib/flakes.go matched.

Log: https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_oadp-operator/2206/pull-ci-openshift-oadp-operator-oadp-1.6-4.23-e2e-test-aws/2087353890981810176

This appears to be a pre-existing, long-standing bug rather than something introduced by #2206 — it just happened to get exercised by that PR's e2e run.

[!Note]
Responses generated with Claude

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the DaemonSet deletion path in internal/controller/nodeagent.go, or controllers/nodeagent.go for the oadp-1.4 branch, and compare it with the adjacent ConfigMap deletion path. Review the cleanup scenario in tests/e2e/dpa_deployment_suite_test.go and the related CI log. Done means NotFound deletion is treated as success without a DeleteDaemonSetFailed event or reconciliation failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.