client

package
v0.0.0-...-a426a1e Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNamespace

func CreateNamespace(c clientset.Interface, namespace string) error

CreateNamespace creates a single namespace with given name.

func CreateObject

func CreateObject(dynamicClient dynamic.Interface, namespace string, name string, obj *unstructured.Unstructured, options ...*ApiCallOptions) error

CreateObject creates object based on given object description.

func DeleteNamespace

func DeleteNamespace(c clientset.Interface, namespace string) error

DeleteNamespace deletes namespace with given name.

func DeleteObject

func DeleteObject(dynamicClient dynamic.Interface, gvk schema.GroupVersionKind, namespace string, name string, options ...*ApiCallOptions) error

DeleteObject deletes object with given name, group, version and kind.

func GetObject

func GetObject(dynamicClient dynamic.Interface, gvk schema.GroupVersionKind, namespace string, name string, options ...*ApiCallOptions) (*unstructured.Unstructured, error)

GetObject retrieves object with given name, group, version and kind.

func IsRetryableAPIError

func IsRetryableAPIError(err error) bool

IsRetryableAPIError verifies whether the error is retryable.

func IsRetryableNetError

func IsRetryableNetError(err error) bool

IsRetryableNetError determines whether the error is a retryable net error.

func ListEvents

func ListEvents(c clientset.Interface, namespace string, name string, options ...*ApiCallOptions) (obj *apiv1.EventList, err error)

ListEvents retrieves events for the object with the given name.

func ListNamespaces

func ListNamespaces(c clientset.Interface) ([]apiv1.Namespace, error)

ListNamespaces returns list of existing namespace names.

func ListNodes

func ListNodes(c clientset.Interface) ([]apiv1.Node, error)

ListNodes returns list of cluster nodes.

func ListNodesWithOptions

func ListNodesWithOptions(c clientset.Interface, listOpts metav1.ListOptions) ([]apiv1.Node, error)

ListNodesWithOptions lists the cluster nodes using the provided options.

func ListPodsWithOptions

func ListPodsWithOptions(c clientset.Interface, namespace string, listOpts metav1.ListOptions) ([]apiv1.Pod, error)

ListPodsWithOptions lists the pods using the provided options.

func PatchObject

func PatchObject(dynamicClient dynamic.Interface, namespace string, name string, obj *unstructured.Unstructured, options ...*ApiCallOptions) error

PatchObject updates (using patch) object with given name, group, version and kind based on given object description.

func RetryFunction

func RetryFunction(f func() error, options ...*ApiCallOptions) wait.ConditionFunc

RetryFunction opaques given function into retryable function.

func RetryWithExponentialBackOff

func RetryWithExponentialBackOff(fn wait.ConditionFunc) error

RetryWithExponentialBackOff a utility for retrying the given function with exponential backoff.

func WaitForDeleteNamespace

func WaitForDeleteNamespace(c clientset.Interface, namespace string) error

WaitForDeleteNamespace waits untils namespace is terminated.

Types

type ApiCallOptions

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

ApiCallOptions describes how api call errors should be treated, i.e. which errors should be allowed (ignored) and which should be retried.

func Allow

func Allow(allowErrorPredicate func(error) bool) *ApiCallOptions

Allow creates an ApiCallOptions that allows (ignores) errors matching the given predicate.

func Retry

func Retry(retryErrorPredicate func(error) bool) *ApiCallOptions

Retry creates an ApiCallOptions that retries errors matching the given predicate.

Jump to

Keyboard shortcuts

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