Skip to content

Bug: copier error in ReconcileWorkerSliceConfig logged but not returned β€” zero-value config written to clusterΒ #399

Description

@mdryaaan

πŸ“œ Description

In ReconcileWorkerSliceConfig, copier.CopyWithOption is used at line 230 to deep-copy externalGatewayControllersConfig into externalGatewayConfig. If the copy fails, the error is logged at line 234 but execution continues. At line 275, workerSliceConfig.Spec.ExternalGatewayConfig = externalGatewayConfig writes the zero-value (empty) struct to the Kubernetes API. Worker clusters then receive an empty external gateway config, silently losing all gateway configuration.

πŸ‘Ÿ Reproduction steps

  1. Read service/worker_slice_config_service.go:230-235 β€” error from copier.CopyWithOption is logged but not returned.
  2. Read line 275 β€” workerSliceConfig.Spec.ExternalGatewayConfig = externalGatewayConfig unconditionally writes the result.
  3. If copier.CopyWithOption fails at runtime, externalGatewayConfig remains as its zero value and overwrites real config on the worker slice.

πŸ‘ Expected behavior

If copier.CopyWithOption returns an error, ReconcileWorkerSliceConfig should return ctrl.Result{}, err immediately so the bad value is never written to Kubernetes.

πŸ‘Ž Actual Behavior

The error is logged and execution continues. A zero-value ExternalGatewayConfig is written to the worker slice config resource, silently erasing the real gateway configuration.

🐚 Relevant log output

Version

main branch β€” run git describe --tags in the repo

πŸ–₯️ What operating system are you seeing the problem on?

Linux

βœ… Proposed Solution

Change lines 233–235 from logging-and-continuing to returning the error:

if err != nil {
    return ctrl.Result{}, err
}

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find any similar issue

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions