Skip to content

fix(dataprotection): label backup workloads for cleanup#10672

Merged
leon-ape merged 1 commit into
mainfrom
bugfix/dataprotection-backup-workload-managed-by
Jul 20, 2026
Merged

fix(dataprotection): label backup workloads for cleanup#10672
leon-ape merged 1 commit into
mainfrom
bugfix/dataprotection-backup-workload-managed-by

Conversation

@weicao

@weicao weicao commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Closes #10675

What problem does this solve?

Backup-owned Jobs and continuous backup StatefulSets could inherit a non-DataProtection app.kubernetes.io/managed-by label from the parent Backup. DataProtection watch and cleanup selectors require kubeblocks-dataprotection, so those workloads could be missed.

What is changed?

  • Force BuildBackupWorkloadLabels to set managed-by=kubeblocks-dataprotection after copying parent labels.
  • Keep the parent Backup labels unchanged.
  • Keep existing watch and cleanup selectors narrow.
  • Cover helper output, parent non-mutation, nil labels, Action Job, BackupData Job, and continuous StatefulSet metadata/template labels.

Existing workloads with the historical wrong label are not migrated by this change.

Validation

  • Focused tests N=3
  • Focused race test
  • Full pkg/dataprotection/backup and controllers/dataprotection tests
  • go vet, lint, generated-file checks, and full make check-diff

@weicao
weicao requested review from a team, ldming and wangyelei as code owners July 15, 2026 13:51
@apecloud-bot

Copy link
Copy Markdown
Collaborator

Auto Cherry-pick Instructions

Usage:
  - /nopick: Not auto cherry-pick when PR merged.
  - /pick: release-x.x [release-x.x]: Auto cherry-pick to the specified branch when PR merged.

Example:
  - /nopick
  - /pick release-1.1

CLA Recheck Instructions

Usage:
  - /recheck-cla: Trigger a re-check of CLA status for this pull request.
Example:
  - /recheck-cla

@github-actions github-actions Bot added the size/S Denotes a PR that changes 10-29 lines. label Jul 15, 2026
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.34%. Comparing base (12611aa) to head (40b7b2a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10672      +/-   ##
==========================================
+ Coverage   63.97%   64.34%   +0.37%     
==========================================
  Files         520      520              
  Lines       62887    63298     +411     
==========================================
+ Hits        40229    40730     +501     
+ Misses      19071    19000      -71     
+ Partials     3587     3568      -19     
Flag Coverage Δ
unittests 64.34% <100.00%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@weicao weicao added the nopick Not auto cherry-pick when PR merged label Jul 15, 2026
@apecloud-bot apecloud-bot added the approved PR Approved Test label Jul 20, 2026
@leon-ape
leon-ape merged commit ff1ed72 into main Jul 20, 2026
46 of 47 checks passed
@leon-ape
leon-ape deleted the bugfix/dataprotection-backup-workload-managed-by branch July 20, 2026 09:56
@github-actions github-actions Bot added this to the Release 1.2.0 milestone Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR Approved Test nopick Not auto cherry-pick when PR merged size/S Denotes a PR that changes 10-29 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Backup-owned workloads can escape DataProtection cleanup

3 participants