Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeadm: apply retries to all API calls in idempotency.go #123271

Merged
merged 1 commit into from Feb 19, 2024

Commits on Feb 18, 2024

  1. kubeadm: apply retries to all API calls in idempotency.go

    The idempotency.go (perhaps not so accurately named) contains
    API calls that kubeadm does against an API server using client-go.
    
    Some users seem to have unstable setups where for unknown reasons
    the API server can be unavailable or refuse to respond as expected.
    
    Use PollUntilContextTimeout in all exported functions to ensure
    such API calls are all retry-able.
    
    NOTE: The context passed to PollUntilContextTimeout is not propagated
    in the polled function. Instead the poll function creates it's own
    context 'ctx := context.Background()', this is to avoid
    breaking expectations on the side of the callers, that expect
    a certain type of error and not "context timeout" errors.
    
    Additional changes:
    - Make all context.TODO() -> context.Background()
    - Update all unit tests and make sure during testing the retry
    interval and timeout are short. Test coverage of idempotency.go
    is at ~97%.
    - Remove the TestMutateConfigMapWithConflict test. It does not
    contribute much, because conflict handling is done at the API,
    server side, not on the side of kubeadm. This simulating this is not
    needed.
    neolit123 committed Feb 18, 2024
    Configuration menu
    Copy the full SHA
    c29450e View commit details
    Browse the repository at this point in the history