kapi

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ReasonableMutateTime is how long to wait for basic object mutations, such as deletions, to show up
	ReasonableMutateTime = time.Minute * 2
	// ReasonableStartTime is how long to wait for pods to start
	ReasonableStartTime = time.Minute * 5
)

Functions

func Client

func Client(context string) (*kubernetes.Clientset, error)

Client gets the Kubernetes client for a kubectl context name

func ClientConfig

func ClientConfig(context string) (*rest.Config, error)

ClientConfig returns the client configuration for a kubectl context

func IsRetryableAPIError

func IsRetryableAPIError(err error) bool

IsRetryableAPIError returns if this error is retryable or not

func KubectlBinaryPath added in v1.12.0

func KubectlBinaryPath(version string) string

KubectlBinaryPath returns the path to kubectl on the node

func ScaleDeployment added in v1.19.0

func ScaleDeployment(kcontext, namespace, deploymentName string, replicas int) error

ScaleDeployment tries to set the number of deployment replicas in namespace and context. It will retry (usually needed due to "the object has been modified; please apply your changes to the latest version and try again" error) up to ReasonableMutateTime to ensure target scale is achieved.

func WaitForDeploymentToStabilize

func WaitForDeploymentToStabilize(c kubernetes.Interface, ns, name string, timeout time.Duration) error

WaitForDeploymentToStabilize waits till the Deployment has a matching generation/replica count between spec and status. used by integration tests

func WaitForPods added in v1.12.0

func WaitForPods(c kubernetes.Interface, ns string, selector string, timeOut ...time.Duration) error

WaitForPods waits for all matching pods to become Running or finish successfully and at least one matching pod exists.

func WaitForRCToStabilize

func WaitForRCToStabilize(c kubernetes.Interface, ns, name string, timeout time.Duration) error

WaitForRCToStabilize waits till the RC has a matching generation/replica count between spec and status. used by integration tests

func WaitForService

func WaitForService(c kubernetes.Interface, namespace, name string, exist bool, interval, timeout time.Duration) error

WaitForService waits until the service appears (exist == true), or disappears (exist == false)

Types

This section is empty.

Jump to

Keyboard shortcuts

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