Skip to content

Don't let transient failures block config push - #48

Open
kraney wants to merge 1 commit into
srl-labs:mainfrom
kraney:net-retry
Open

Don't let transient failures block config push#48
kraney wants to merge 1 commit into
srl-labs:mainfrom
kraney:net-retry

Conversation

@kraney

@kraney kraney commented Aug 25, 2026

Copy link
Copy Markdown

See #47

  1. When a Pod's readiness probe passed, srlinux_controller.go:98-151 invoked startup_config.go:74-157, which called startup_config.go:295-350.

  2. If network routing or SSH driver initialization timed out or failed (e.g. connect: no route to host during initial CNI route propagation), startup_config.go:295-350 returned nil.

  3. startup_config.go:74-157 exited immediately without setting *update = true or returning an error to srlinux_controller.go:98-151.

  4. srlinux_controller.go:98-151 returned (ctrl.Result{}, nil) (success), preventing controller-runtime from requeueing the reconciliation and leaving the SR Linux node unconfigured.

  5. startup_config.go: • Defined sentinel errors ErrPodIPNotAssigned and ErrNetworkNotReady. • Updated startup_config.go:252-287 to return (string, error) and check for existing pod IP immediately before entering the ticker loop. • Updated startup_config.go:352-384 and startup_config.go:295-350 to return (*network.Driver, error). • Updated startup_config.go:74-157 signature to (ctrl.Result, bool, error) following controller conventions, propagating network errors back to the caller.

  6. srlinux_controller.go: • Updated srlinux_controller.go:137-144 to check return values from startup_config.go:74-157. When network connectivity fails, the error is returned to controller-runtime, triggering rate-limited exponential backoff and retries. • Reset the update flag after pod status sync to avoid duplicate updates.

  7. srlinux_controller_test.go: • Added unit test TestSrlinuxReconcile_NetworkNotReady to verify that transient network connectivity failures return an error from Reconcile(). • Added unit test TestSrlinuxReconcile_StartupConfigAlreadyProcessed to verify that processed startup configs are skipped without error.

1. When a Pod's readiness probe passed, srlinux_controller.go:98-151 invoked startup_config.go:74-157, which called
startup_config.go:295-350.
2. If network routing or SSH driver initialization timed out or failed (e.g. connect: no route to host during initial CNI route
propagation), startup_config.go:295-350 returned nil.
3. startup_config.go:74-157 exited immediately without setting *update = true or returning an error to srlinux_controller.go:98-151.
4. srlinux_controller.go:98-151 returned (ctrl.Result{}, nil) (success), preventing controller-runtime from requeueing the reconciliation
and leaving the SR Linux node unconfigured.

1. **startup_config.go**:
    • Defined sentinel errors ErrPodIPNotAssigned and ErrNetworkNotReady.
    • Updated startup_config.go:252-287 to return (string, error) and check for existing pod IP immediately before entering the ticker loop.
    • Updated startup_config.go:352-384 and startup_config.go:295-350 to return (*network.Driver, error).
    • Updated startup_config.go:74-157 signature to (ctrl.Result, bool, error) following controller conventions, propagating network errors
    back to the caller.
2. **srlinux_controller.go**:
    • Updated srlinux_controller.go:137-144 to check return values from startup_config.go:74-157. When network connectivity fails, the
    error is returned to controller-runtime, triggering rate-limited exponential backoff and retries.
    • Reset the update flag after pod status sync to avoid duplicate updates.
3. **srlinux_controller_test.go**:
    • Added unit test TestSrlinuxReconcile_NetworkNotReady to verify that transient network connectivity failures return an error from
    Reconcile().
    • Added unit test TestSrlinuxReconcile_StartupConfigAlreadyProcessed to verify that processed startup configs are skipped without error.
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.

1 participant