Skip to content

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
kubeslice:masterfrom
mdryaan:fix/workersliceconfig-copier-error-unhandled
Open

fix(worker-slice-config): return error on copier failure instead of continuing with zero-value gateway config#400
mdryaan wants to merge 1 commit into
kubeslice:masterfrom
mdryaan:fix/workersliceconfig-copier-error-unhandled

Conversation

@mdryaan

@mdryaan mdryaan commented May 28, 2026

Copy link
Copy Markdown

Description

In ReconcileWorkerSliceConfig, a copier.CopyWithOption failure at service/worker_slice_config_service.go:233 was logged and silently swallowed. Execution continued to line 275 where workerSliceConfig.Spec.ExternalGatewayConfig = externalGatewayConfig unconditionally wrote the zero-value struct to the Kubernetes API, erasing real gateway configuration on worker clusters. Replaced the log-and-continue with return ctrl.Result{}, err so 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: the if err != nil branch previously called logger.With(zap.Error(err)).Errorf(...) and fell through; changed to return 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 fmt passes with no diff.
  • Pre-existing make vet and make unit-test failures (undefined: util.Client, unknown field ClusterName) are present on unmodified master and are unrelated to this change.

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates? — No.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas. — N/A.
  • I have tested it for all user roles. — N/A, controller-level fix.
  • I have added all the required unit test cases.

Does this PR introduce a breaking change for other components like worker-operator?

No

Fix ReconcileWorkerSliceConfig silently writing zero-value ExternalGatewayConfig to worker clusters when deep copy fails

…ontinuing with zero-value gateway config

Signed-off-by: mdryaan <alikhurshid4u@gmail.com>
@mdryaan mdryaan requested a review from that-backend-guy as a code owner May 28, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: copier error in ReconcileWorkerSliceConfig logged but not returned — zero-value config written to cluster

1 participant