util

package
v0.0.0-...-da112ce Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TransientBackoff = wait.Backoff{
	Steps:    3,
	Duration: 500 * time.Millisecond,
	Factor:   2.0,
	Jitter:   0.1,
}

TransientBackoff defines the retry parameters for transient API errors. 3 steps with 500ms base and 2.0 factor gives: 500ms, 1s, 2s = ~3.5s max per call.

Functions

func ExcludeNamesFilter

func ExcludeNamesFilter(names ...string) factory.EventFilterFunc

Inverse of IncludeNamesFilter

func HandleManagementState

func HandleManagementState(ctx context.Context, c consoleOperatorController, operatorClient v1helpers.OperatorClient) error

func IncludeNamesFilter

func IncludeNamesFilter(names ...string) factory.EventFilterFunc

Return func which returns true if obj name is in names

func IsExternalControlPlaneWithIngressDisabled

func IsExternalControlPlaneWithIngressDisabled(infrastructureConfig *configv1.Infrastructure, clusterVersionConfig *configv1.ClusterVersion) bool

IsExternalControlPlaneWithIngressDisabled returns true if the cluster is in external control plane topology (hypershift) and the ingress cluster capability is disabled.

func IsRetryableError

func IsRetryableError(err error) bool

IsRetryableError returns true for errors worth retrying — everything except known permanent errors. This naturally handles both API status errors (apierrors.StatusError) and network-level errors (connection refused, EOF, TLS failures) without explicit net.Error detection.

func LabelFilter

func LabelFilter(labels map[string]string) factory.EventFilterFunc

Return a func which returns true if obj matches on every label in labels (i.e for each key in labels map, obj.metadata.labels[key] is equal to labels[key])

func RetryOnTransientError

func RetryOnTransientError(fn func() error) error

RetryOnTransientError wraps a function call with retry logic to absorb transient API server errors (conflicts, timeouts, connection refused) that occur during upgrades. Only API write operations (Apply, Create, Update, Delete) should be wrapped — not lister/cache reads.

Types

type InformerWithSwitch

type InformerWithSwitch struct {
	// contains filtered or unexported fields
}

func NewSwitchedInformer

func NewSwitchedInformer(
	ctx context.Context,
	oauthClient authclient.Interface,
	resync time.Duration,
	authnInformer configv1informers.AuthenticationInformer,
	recorder events.Recorder,
) *InformerWithSwitch

func (*InformerWithSwitch) Informer

func (*InformerWithSwitch) Lister

func (*InformerWithSwitch) Start

func (s *InformerWithSwitch) Start(stopCh <-chan struct{})

Jump to

Keyboard shortcuts

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