netretry

package
v5.62.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package netretry provides shared retry utilities for transient network errors across Kubernetes client packages (Docker, Helm, etc.).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExponentialDelay

func ExponentialDelay(
	attempt int,
	baseWait, maxWait time.Duration,
) time.Duration

ExponentialDelay returns the delay for the given retry attempt using exponential backoff. Uses the formula: min(baseWait * 2^(attempt-1), maxWait).

func IsRetryable

func IsRetryable(err error) bool

IsRetryable returns true if the error indicates a transient network error that should be retried. This covers HTTP 429 and 500–504 status codes and TCP-level errors such as connection resets, timeouts, and unexpected EOF. Callers that need to handle additional domain-specific transient errors (e.g., Copilot auth "fetch failed") should augment this function with a local helper.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL