util

package
v0.0.0-...-6d33011 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComponentImageName

func ComponentImageName(repository, component, version string) string

func ComponentName

func ComponentName(component, name string) string

func InternetIP

func InternetIP() (net.IP, error)

InternetIP Current host Internet IP.

func KubeConfigFromSecret

func KubeConfigFromSecret(client kubernetes.Interface, cluster *clusterv1alpha1.Cluster) (*clientcmdapi.Config, error)

func TryRunCommand

func TryRunCommand(f func() error, failureThreshold int) error

TryRunCommand runs a function a maximum of failureThreshold times, and retries on error. If failureThreshold is hit; the last error is returned

Types

type KubeWaiter

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

KubeWaiter is an implementation of Waiter that is backed by a Kubernetes client

func (*KubeWaiter) SetTimeout

func (w *KubeWaiter) SetTimeout(timeout time.Duration)

SetTimeout adjusts the timeout to the specified duration

func (*KubeWaiter) WaitForKubeAPI

func (w *KubeWaiter) WaitForKubeAPI() error

WaitForKubeAPI waits for the API Server's /healthz endpoint to report "ok"

func (*KubeWaiter) WaitForPodsWithLabel

func (w *KubeWaiter) WaitForPodsWithLabel(namespace, kvLabel string) error

WaitForPodsWithLabel will lookup pods with the given label and wait until they are all reporting status as running.

type Waiter

type Waiter interface {
	// WaitForKubeAPI waits for the API Server's /healthz endpoint to become "ok"
	WaitForKubeAPI() error
	// WaitForPodsWithLabel waits for Pods in a given namespace to become Ready
	WaitForPodsWithLabel(namespace, kvLabel string) error
	// // WaitForHealthyKubelet blocks until the kubelet /healthz endpoint returns 'ok'
	// WaitForHealthyKubelet(initialTimeout time.Duration, healthzEndpoint string) error
	// // WaitForKubeletAndFunc is a wrapper for WaitForHealthyKubelet that also blocks for a function
	// WaitForKubeletAndFunc(f func() error) error
	// SetTimeout adjusts the timeout to the specified duration
	SetTimeout(timeout time.Duration)
}

Waiter is an interface for waiting for criteria in Kubernetes to happen

func NewKubeWaiter

func NewKubeWaiter(client clientset.Interface, timeout time.Duration) Waiter

NewKubeWaiter returns a new Waiter object that talks to the given Kubernetes cluster

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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