Skip to content

fix: align instance api pvc labels with instanceset - #10588

Merged
leon-ape merged 1 commit into
mainfrom
bugfix/issue-10576-instance-pvc-labels
Jul 9, 2026
Merged

fix: align instance api pvc labels with instanceset#10588
leon-ape merged 1 commit into
mainfrom
bugfix/issue-10576-instance-pvc-labels

Conversation

@leon-ape

@leon-ape leon-ape commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

What changed

Instance API PVC creation now merges pod template labels into generated PVCs, matching the existing InstanceSet PVC label behavior.

Why

The InstanceSet path adds template labels to PVCs. The InstanceSet2 + Instance API path already applies template labels to the Instance and Pod, but did not carry those labels into PVCs. That made PVCs miss component identity labels such as app.kubernetes.io/instance and apps.kubeblocks.io/component-name, so volume expansion progress lookup could not discover them by the existing label selector.

This keeps the behavior scoped to template labels and does not copy all Instance object labels to PVCs.
The Instance API PVC identity label apps.kubeblocks.io/instance-name remains owned by the Instance controller so deletion/retention reconciliation can still find the PVCs.

Fix #10576.

Validation

go test ./pkg/controller/instance
go test ./controllers/workloads -run TestAPIs -ginkgo.focus "Instance Controller.*delete - (delete|retain) pvc" -count=1
go test ./controllers/workloads -run TestAPIs -count=1

@leon-ape leon-ape added the pick-1.1 Auto cherry-pick to release-1.1 when PR merged label Jul 9, 2026
@github-actions github-actions Bot added the size/S Denotes a PR that changes 10-29 lines. label Jul 9, 2026
@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

@leon-ape leon-ape linked an issue Jul 9, 2026 that may be closed by this pull request
@leon-ape
leon-ape force-pushed the bugfix/issue-10576-instance-pvc-labels branch from 9014bdf to fd01deb Compare July 9, 2026 02:22
@leon-ape leon-ape changed the title fix instance pvc template labels align instance api pvc labels with instanceset Jul 9, 2026
@leon-ape leon-ape changed the title align instance api pvc labels with instanceset fix: align instance api pvc labels with instanceset Jul 9, 2026
@leon-ape
leon-ape marked this pull request as ready for review July 9, 2026 02:24
@leon-ape
leon-ape requested a review from a team as a code owner July 9, 2026 02:24
@leon-ape

leon-ape commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Jul 9, 2026
@leon-ape
leon-ape force-pushed the bugfix/issue-10576-instance-pvc-labels branch from fd01deb to 0915522 Compare July 9, 2026 02:41
@github-actions github-actions Bot removed the size/S Denotes a PR that changes 10-29 lines. label Jul 9, 2026
@apecloud-bot apecloud-bot removed the approved PR Approved Test label Jul 9, 2026
@github-actions github-actions Bot added the size/M Denotes a PR that changes 30-99 lines. label Jul 9, 2026
@leon-ape
leon-ape marked this pull request as draft July 9, 2026 02:41
@leon-ape

leon-ape commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

/approve

@leon-ape
leon-ape marked this pull request as ready for review July 9, 2026 02:41
@apecloud-bot apecloud-bot added the approved PR Approved Test label Jul 9, 2026
@leon-ape
leon-ape force-pushed the bugfix/issue-10576-instance-pvc-labels branch from 0915522 to d11a9de Compare July 9, 2026 02:45
@apecloud-bot apecloud-bot removed the approved PR Approved Test label Jul 9, 2026
@leon-ape
leon-ape marked this pull request as draft July 9, 2026 02:46
@leon-ape
leon-ape marked this pull request as ready for review July 9, 2026 02:46
@leon-ape

leon-ape commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Jul 9, 2026
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.79%. Comparing base (27588ee) to head (d11a9de).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/instance/utils.go 75.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10588      +/-   ##
==========================================
+ Coverage   63.74%   63.79%   +0.05%     
==========================================
  Files         519      519              
  Lines       62848    62859      +11     
==========================================
+ Hits        40060    40100      +40     
+ Misses      19178    19155      -23     
+ Partials     3610     3604       -6     
Flag Coverage Δ
unittests 63.79% <75.00%> (+0.05%) ⬆️

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 merged commit 100e747 into main Jul 9, 2026
73 of 79 checks passed
@leon-ape
leon-ape deleted the bugfix/issue-10576-instance-pvc-labels branch July 9, 2026 03:37
@github-actions github-actions Bot added this to the Release 1.2.0 milestone Jul 9, 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 pkg/controller/instance/utils.go
Auto-merging pkg/controller/instance/utils_test.go
CONFLICT (content): Merge conflict in pkg/controller/instance/utils_test.go
error: could not apply 100e747... fix: align instance api pvc labels with instanceset (#10588)
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/28992267478

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/M Denotes a PR that changes 30-99 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG][multi-cluster] VolumeExpansion ops fails

2 participants