Skip to content

fix(dataprotection): pass target metadata to post-ready jobs - #10838

Merged
leon-ape merged 6 commits into
mainfrom
bugfix/post-ready-target-env
Sep 1, 2026
Merged

fix(dataprotection): pass target metadata to post-ready jobs#10838
leon-ape merged 6 commits into
mainfrom
bugfix/post-ready-target-env

Conversation

@leon-ape

@leon-ape leon-ape commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Fixes #10679

What

Pass the restore target topology and expected service version to postReady Jobs targeting KubeBlocks Pods:

  • DP_TARGET_CLUSTER_TOPOLOGY from Cluster.spec.topology
  • DP_TARGET_SERVICE_VERSION from the selected Pod instance-template override, falling back to Component.spec.serviceVersion

Implementation

BuildPostReadyActionJobs resolves both values after selecting the target Pod. The Job builder removes duplicate caller or Pod values and appends the controller values once, after the existing Restore, ActionSet, BackupMethod, credential, and Pod environment merge.

The behavior is selected by the existing KubeBlocks cluster/component labels on the target Pod. A target without those labels keeps the existing behavior. This change does not add an internal Restore marker, identity protocol, owner-chain validation, uncached-reader plumbing, or a new API.

Validation

  • full pkg/dataprotection/restore package: PASS
  • make lint: PASS
  • focused go vet for DataProtection packages: PASS
  • make manifests: PASS
  • git diff --check: PASS

Backport check

  • release-1.1: final patch cherry-picks cleanly; restore package and make lint pass
  • release-1.0: not suitable for automatic cherry-pick; the branch lacks instance-template serviceVersion and its Pod label, so a tailored backport must use Component.spec.serviceVersion only

@leon-ape
leon-ape requested review from a team, ldming and wangyelei as code owners September 1, 2026 05:47
@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/L Denotes a PR that changes 100-499 lines. label Sep 1, 2026
@leon-ape leon-ape added the nopick Not auto cherry-pick when PR merged label Sep 1, 2026
@leon-ape leon-ape added pick-1.1 Auto cherry-pick to release-1.1 when PR merged and removed nopick Not auto cherry-pick when PR merged labels Sep 1, 2026
@leon-ape

leon-ape commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Sep 1, 2026
@apecloud-bot apecloud-bot removed the approved PR Approved Test label Sep 1, 2026
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.84127% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.75%. Comparing base (cdc2d7d) to head (b1d2ae8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/dataprotection/restore/manager.go 68.00% 11 Missing and 5 partials ⚠️
pkg/dataprotection/restore/builder.go 76.92% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10838      +/-   ##
==========================================
+ Coverage   65.69%   65.75%   +0.06%     
==========================================
  Files         510      510              
  Lines       64800    64860      +60     
==========================================
+ Hits        42568    42649      +81     
+ Misses      18447    18435      -12     
+ Partials     3785     3776       -9     
Flag Coverage Δ
unittests 65.75% <69.84%> (+0.06%) ⬆️

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.

@leon-ape

leon-ape commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Sep 1, 2026
@leon-ape
leon-ape merged commit 305e2ae into main Sep 1, 2026
63 of 69 checks passed
@leon-ape
leon-ape deleted the bugfix/post-ready-target-env branch September 1, 2026 09:07
@github-actions github-actions Bot added this to the Release 1.2.0 milestone Sep 1, 2026
@apecloud-bot

Copy link
Copy Markdown
Collaborator

/cherry-pick release-1.1

@apecloud-bot

Copy link
Copy Markdown
Collaborator

🤖 says: Error cherry-picking.

Auto-merging controllers/dataprotection/restore_controller_test.go
CONFLICT (content): Merge conflict in controllers/dataprotection/restore_controller_test.go
Auto-merging pkg/dataprotection/restore/builder.go
Auto-merging pkg/dataprotection/restore/manager.go
Auto-merging pkg/dataprotection/restore/manager_test.go
Auto-merging pkg/dataprotection/types/constant.go
error: could not apply 305e2ae... fix(dataprotection): pass target metadata to post-ready jobs (#10838)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

@apecloud-bot

Copy link
Copy Markdown
Collaborator

🤖 says: ‼️ cherry pick action failed.
See: https://github.com/apecloud/kubeblocks/actions/runs/33490627064

@leon-ape

leon-ape commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

The automatic release-1.1 cherry-pick conflict has been resolved manually in #10839. The release-1.1 restore tests, full DataProtection controller suite, and make lint pass locally.

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

Labels

approved PR Approved Test pick-1.1 Auto cherry-pick to release-1.1 when PR merged size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StarRocks logical restore lacks trustworthy target topology and expected service version

2 participants