feat(sandboxid): implement core short sandbox ID logic#657
feat(sandboxid): implement core short sandbox ID logic#657singhsrijan46 wants to merge 2 commits into
Conversation
Signed-off-by: Srijan <singhsrijangkp@gmail.com>
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
…and clone tests Signed-off-by: Srijan <singhsrijangkp@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #657 +/- ##
==========================================
+ Coverage 80.06% 80.08% +0.01%
==========================================
Files 229 230 +1
Lines 17862 17895 +33
==========================================
+ Hits 14302 14332 +30
- Misses 2975 2978 +3
Partials 585 585
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Ⅰ. Describe what this PR does
This pull request introduces the core
sandboxidpackage and lays the groundwork for supporting short, stable Sandbox IDs as specified in the design spec:LabelSandboxID(agents.kruise.io/sandbox-id) toapi/v1alpha1/sandboxset_types.go.sandboxidpackage):GenerateShort) to authoritatively map Sandbox UID to a DNS-safe label.Resolve) which resolves using the short ID label with a fallback to the deterministically-formatted legacy ID (<namespace>--<name>).AssignShort).resetMetadataForPoolinpkg/controller/sandbox/core/recycle.goto explicitly preserveLabelSandboxIDduring sandbox recycling.assert.Greatervsassert.GreaterOrEqual) inpkg/sandbox-manager/infra/sandboxcr/claim_test.goandclone_test.gowhere fast mock clocks or immediate rate limit error returns yielded exactly0swait times.Ⅱ. Does this pull request fix one issue?
NONE
Ⅲ. Describe how to verify it
Unit tests have been added and verified:
go test -v ./pkg/sandbox-manager/sandboxid/...go test -v ./pkg/controller/sandbox/core/...go test -v ./pkg/sandbox-manager/infra/sandboxcr/...Ⅳ. Special notes for reviews
The timing assertions for
WaitandWaitReadymetrics insandboxcrwere adjusted toassert.GreaterOrEqualto eliminate flakes on fast test runners/environments.