Documentation ¶
Index ¶
- Constants
- func CreateNamespace(c clientset.Interface, namespace string) error
- func CreateObject(dynamicClient dynamic.Interface, namespace string, name string, ...) error
- func DeleteNamespace(c clientset.Interface, namespace string) error
- func DeleteObject(dynamicClient dynamic.Interface, gvk schema.GroupVersionKind, namespace string, ...) error
- func DeleteStorageClass(c clientset.Interface, name string) error
- func GetObject(dynamicClient dynamic.Interface, gvk schema.GroupVersionKind, namespace string, ...) (*unstructured.Unstructured, error)
- func IsRetryableAPIError(err error) bool
- func IsRetryableNetError(err error) bool
- func ListEvents(c clientset.Interface, namespace string, name string, ...) (obj *apiv1.EventList, err error)
- func ListNamespaces(c clientset.Interface) ([]apiv1.Namespace, error)
- func ListNodes(c clientset.Interface) ([]apiv1.Node, error)
- func ListNodesWithOptions(c clientset.Interface, listOpts metav1.ListOptions) ([]apiv1.Node, error)
- func ListPodsWithOptions(c clientset.Interface, namespace string, listOpts metav1.ListOptions) ([]apiv1.Pod, error)
- func PatchObject(dynamicClient dynamic.Interface, namespace string, name string, ...) error
- func RetryFunction(f func() error, options ...*APICallOptions) wait.ConditionFunc
- func RetryWithExponentialBackOff(fn wait.ConditionFunc) error
- func WaitForDeleteNamespace(c clientset.Interface, namespace string, timeout time.Duration) error
- type APICallOptions
Constants ¶
const ( // Parameters for namespace deletion operations. DefaultNamespaceDeletionTimeout = 10 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func CreateNamespace ¶
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 ¶
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 DeleteStorageClass ¶
DeleteStorageClass deletes storage class with given name.
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 ¶
IsRetryableAPIError verifies whether the error is retryable.
func IsRetryableNetError ¶
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 ¶
ListNamespaces returns list of existing namespace names.
func ListNodesWithOptions ¶
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.
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.