Skip to content

to achieve dynamic remounting of CSI storage after a sandbox instance…#254

Closed
BH4AWS wants to merge 1 commit intoopenkruise:masterfrom
BH4AWS:feat/update_for_support_csi_mount_after_resuming
Closed

to achieve dynamic remounting of CSI storage after a sandbox instance…#254
BH4AWS wants to merge 1 commit intoopenkruise:masterfrom
BH4AWS:feat/update_for_support_csi_mount_after_resuming

Conversation

@BH4AWS
Copy link
Copy Markdown
Contributor

@BH4AWS BH4AWS commented Apr 4, 2026

… resumes from hibernation

Ⅰ. Describe what this PR does

1\ In order to achieve dynamic remounting of CSI storage after a sandbox instance resumes from hibernation, some shared code logic needs to be adjusted in advance. The next PR will implement CSI storage remounting after hibernation and resume based on the object-oriented approach of SandboxClaim.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

@kruise-bot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

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

}

func NewSandboxControl(c client.Client, recorder record.EventRecorder, rl *RateLimiter) map[string]SandboxControl {
func NewSandboxControl(c client.Client, recorder record.EventRecorder, rl *RateLimiter, sandboxClient *clients.ClientSet, cache *sandboxcr.Cache) map[string]SandboxControl {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use funcArgs to contain all the parameters, e.g. client, recorder.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done,using struct

originObj.Annotations = make(map[string]string)
}
_, hashWithoutImageAndResource := core.HashSandbox(box)
_, hashWithoutImageAndResource := sandboxcr.HashSandbox(box)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the HashSandbox to pkg/util ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE

@BH4AWS BH4AWS force-pushed the feat/update_for_support_csi_mount_after_resuming branch 2 times, most recently from 7be9446 to 5bd8efa Compare April 21, 2026 04:05
… resumes from hibernation

Signed-off-by: jicheng.sk <jicheng.sk@alibaba-inc.com>
@BH4AWS BH4AWS force-pushed the feat/update_for_support_csi_mount_after_resuming branch from 5bd8efa to 7c13c7f Compare April 23, 2026 15:35
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 51.92308% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.48%. Comparing base (cdaf6bb) to head (7c13c7f).
⚠️ Report is 23 commits behind head on master.

Files with missing lines Patch % Lines
pkg/controller/sandbox/sandbox_controller.go 11.11% 16 Missing ⚠️
pkg/controller/sandbox/core/common_control.go 0.00% 5 Missing ⚠️
pkg/controller/sandbox/core/interface.go 0.00% 2 Missing ⚠️
pkg/utils/hash_utils.go 88.23% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #254      +/-   ##
==========================================
+ Coverage   69.34%   71.48%   +2.14%     
==========================================
  Files         112      117       +5     
  Lines        8126     8625     +499     
==========================================
+ Hits         5635     6166     +531     
+ Misses       2195     2150      -45     
- Partials      296      309      +13     
Flag Coverage Δ
unittests 71.48% <51.92%> (+2.14%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Comment thread pkg/utils/hash_utils.go
// hash using sandbox.spec.template without image and resources
tempClone := box.Spec.Template.DeepCopy()
for i := range tempClone.Spec.Containers {
container := &tempClone.Spec.Containers[i]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plz rebase the master, HashSandbox func is changed in the master

@kruise-bot
Copy link
Copy Markdown

@BH4AWS: PR needs rebase.

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/test-infra repository.

@furykerry furykerry closed this Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants