fix(worker-slice-config): return error on copier failure instead of continuing with zero-value gateway config#400
Open
mdryaan wants to merge 1 commit into
Conversation
…ontinuing with zero-value gateway config Signed-off-by: mdryaan <alikhurshid4u@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
In
ReconcileWorkerSliceConfig, acopier.CopyWithOptionfailure atservice/worker_slice_config_service.go:233was logged and silently swallowed. Execution continued to line 275 whereworkerSliceConfig.Spec.ExternalGatewayConfig = externalGatewayConfigunconditionally wrote the zero-value struct to the Kubernetes API, erasing real gateway configuration on worker clusters. Replaced the log-and-continue withreturn ctrl.Result{}, errso the reconciler stops and controller-runtime requeues. Also removed the now-unused"go.uber.org/zap"import.Fixes #399
How Has This Been Tested?
service/worker_slice_config_service.go:233: theif err != nilbranch previously calledlogger.With(zap.Error(err)).Errorf(...)and fell through; changed toreturn ctrl.Result{}, err. Verified the zero-value write at line 275 is now unreachable on copier failure.go build ./...passes with the change applied.make fmtpasses with no diff.make vetandmake unit-testfailures (undefined: util.Client,unknown field ClusterName) are present on unmodified master and are unrelated to this change.Checklist:
Does this PR introduce a breaking change for other components like worker-operator?
No