fix(worker-slice-config): propagate copier error instead of returning empty spec (#372)#376
Open
Elvand-Lie wants to merge 1 commit into
Open
fix(worker-slice-config): propagate copier error instead of returning empty spec (#372)#376Elvand-Lie wants to merge 1 commit into
Elvand-Lie wants to merge 1 commit into
Conversation
… empty spec (kubeslice#372) Signed-off-by: Elvand-Lie <elvandlie@gmail.com>
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.
Description
copySpecFromSliceConfigToWorkerSliceinservice/worker_slice_config_service.go(lines 687-694) usescopier.Copyto deep-copy the SliceConfig spec into a WorkerSliceConfig. If the copy fails, the function silently returns an emptyWorkerSliceConfig{}with a zeroed spec. The caller then overwrites the existing worker slice config with this empty spec and pushes it to the API server, effectively wiping all slice configuration (SliceSubnet, QoS profile, NamespaceIsolationProfile, etc.).Changes:
service/worker_slice_config_service.go: ChangecopySpecFromSliceConfigToWorkerSlicereturn type to(WorkerSliceConfig, error)and wrap the copier errorReconcileWorkerSliceConfigto check the error and abort reconciliation on failureThe reconciler now returns the error to controller-runtime for requeue with exponential backoff, leaving the existing WorkerSliceConfig intact.
Fixes #372
How Has This Been Tested?
go build ./...passesChecklist:
Does this PR introduce a breaking change for other components like worker-operator?
No. This only affects internal error handling in the WorkerSliceConfig reconciler. No APIs, CRDs, or external interfaces are changed. The behavioral change is that a copier failure now triggers a requeue (correct behavior) instead of silently wiping the worker's slice configuration (incorrect behavior).