watch

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClusterWatcher

func NewClusterWatcher(ctx context.Context,
	managerOptions manager.Options,
	retryOptions RetryOptions,
	watchNamespaces []string) *clusterWatcher

NewClusterWatcher returns a *clusterWatcher, which watches for changes to kubeconfig secrets (which contain kubeconfigs for remote clusters).

  • When ctx is cancelled, all cluster managers started by the clusterWatcher are stopped.
  • Provided manager.Options are applied to all managers started by the clusterWatcher.
  • RetryOptions specify how to retry manager creation if it fails. Any fields not explicitly provided in the retry options will take on the default values.
  • If watchNamespaces is not empty, only secrets in the given namespaces will be watched. If empty, secrets in

all namespaces will be watched.

Types

type RetryDelayType added in v0.26.2

type RetryDelayType int

RetryDelayType is the type of delay to be used for manager creation retries.

const (
	// RetryDelayType_Backoff means retry with exponential backoff (with random jitter).
	RetryDelayType_Backoff RetryDelayType = iota

	// RetryDelayType_Fixed means retry at a fixed interval (with random jitter).
	RetryDelayType_Fixed
)

type RetryOptions added in v0.26.2

type RetryOptions struct {
	// DelayType is the type of retry delay (fixed or exponential backoff).
	// Default is exponential backoff.
	DelayType RetryDelayType

	// Delay is the initial retry delay.
	// Default is 1 second.
	Delay *time.Duration

	// MaxDelay is the maximum delay between retries.
	// Default is 0 (no max).
	MaxDelay *time.Duration

	// MaxJitter is the maximum random jitter between retries.
	// If set to 0, the delay intervals will contain no randomness.
	// Default is the same value as delay (1 second).
	MaxJitter *time.Duration

	// Attempts is the maximum number of attempts.
	// Default is 0 (retry forever).
	Attempts *uint
}

RetryOptions specify how to retry when a manager fails to be created or started.

Jump to

Keyboard shortcuts

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