chore: enrich InstanceSet instance status - #10758
Draft
leon-ape wants to merge 4 commits into
Draft
Conversation
Collaborator
|
Auto Cherry-pick Instructions CLA Recheck Instructions |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #10758 +/- ##
==========================================
+ Coverage 64.56% 64.86% +0.30%
==========================================
Files 521 507 -14
Lines 63343 63662 +319
==========================================
+ Hits 40897 41294 +397
+ Misses 18804 18656 -148
- Partials 3642 3712 +70
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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
InstanceSet.status.instanceStatuswith authoritative template, desired-state, and current-state fieldsInstanceDesiredStateandInstanceCurrentStatePodNameas the stable instance identity and unique list keyPodNamefor both ITS and ITS2, retaining Active/Offline identities while bounding Released cleanupInstance.status.currentState; ITS2 reads and watches Instance objects onlyInstanceStatusObservedGeneration, advanced atomically with a successfully built complete instance viewActiveRunningInstanceStatuses, while excluding Offline/Released entriesWhy
The previous producers rebuilt the list from currently visible runtime objects. That lost allocated identities when instances were absent or intentionally offline, could not reliably preserve template assignments with flat ordinals, and could not distinguish whether the richer instance view had been published for an existing generation.
For ITS2, Pod lifecycle is owned by the Instance controller. The InstanceSet controller therefore consumes the current state reported by Instance and does not load or watch Pods directly.
Legacy
InstanceStatusentries have an emptyCurrentState. The strict effective state remainsUnknown, while runtime consumers use a compatibility view that accepts legacy Active entries and explicit Active+Present entries only.Flat ordinal reassignment may temporarily return a partial allocation while old names are being released. The controller preserves the last complete instance view and its observed generation during that phase, but continues revision and alignment so the allocation can converge.
Validation
make generatemake manifestsmake docgo test ./apis/workloads/v1 ./pkg/controller/instance ./pkg/controller/instancesetstatus ./pkg/controller/instanceset ./pkg/controller/instanceset2go test -p=1 ./pkg/controller/component ./controllers/parameters/reconfigure ./controllers/apps/componentKUBEBUILDER_ASSETS=... go test ./controllers/workloads -run TestAPIs -ginkgo.focus='InstanceSet Controller'go vet