Don't let transient failures block config push - #48
Open
kraney wants to merge 1 commit into
Open
Conversation
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.
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.
See #47
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.
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.
startup_config.go:74-157 exited immediately without setting *update = true or returning an error to srlinux_controller.go:98-151.
srlinux_controller.go:98-151 returned (ctrl.Result{}, nil) (success), preventing controller-runtime from requeueing the reconciliation and leaving the SR Linux node unconfigured.
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.
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.
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.