Documentation ¶
Index ¶
- func IsStatefulSetDegradedPredicate(statefulSet *appsv1.StatefulSet, expectedReplicas int) bool
- func IsStatefulSetReadyPredicate(statefulSet *appsv1.StatefulSet, expectedReplicas int) bool
- func ListPods(ctx context.Context, cs *kubernetes.Clientset, namespace, selector string) (*corev1.PodList, error)
- func WaitForPodBySelector(ctx context.Context, cs *kubernetes.Clientset, namespace, selector string, ...) error
- func WaitForPodReady(ctx context.Context, cs *kubernetes.Clientset, namespace, podName string, ...) error
- func WaitForPodToDisappear(ctx context.Context, cs *kubernetes.Clientset, namespace, podName string, ...) error
- func WaitForReplicaSetSteadyState(ctx context.Context, cs *kubernetes.Clientset, namespace, label string, ...) error
- func WaitForReplicaSetToDisappear(ctx context.Context, cs *kubernetes.Clientset, namespace, rsName string, ...) error
- func WaitForStatefulSetCondition(ctx context.Context, cs *kubernetes.Clientset, namespace, serviceName string, ...) error
- func WaitForStatefulSetGone(ctx context.Context, cs *kubernetes.Clientset, namespace, serviceName string, ...) error
- func WaitForZeroIPPoolAllocations(ctx context.Context, k8sIPAM *kubeClient.KubernetesIPAM, ipPoolCIDR string, ...) error
- type ClientInfo
- func (c *ClientInfo) AddNetAttachDef(netattach *nettypes.NetworkAttachmentDefinition) (*nettypes.NetworkAttachmentDefinition, error)
- func (c *ClientInfo) DelNetAttachDef(netattach *nettypes.NetworkAttachmentDefinition) error
- func (c *ClientInfo) DeletePod(pod *corev1.Pod) error
- func (c *ClientInfo) DeleteReplicaSet(replicaSet *appsv1.ReplicaSet) error
- func (c *ClientInfo) DeleteStatefulSet(namespace string, serviceName string, labelSelector string) error
- func (c *ClientInfo) ProvisionPod(podName string, namespace string, label, annotations map[string]string) (*corev1.Pod, error)
- func (c *ClientInfo) ProvisionReplicaSet(rsName string, namespace string, replicaCount int32, ...) (*appsv1.ReplicaSet, error)
- func (c *ClientInfo) ProvisionStatefulSet(statefulSetName string, namespace string, serviceName string, replicas int, ...) (*appsv1.StatefulSet, error)
- func (c *ClientInfo) ScaleStatefulSet(statefulSetName string, namespace string, deltaInstance int) error
- func (c *ClientInfo) UpdateReplicaSet(replicaSet *appsv1.ReplicaSet) (*appsv1.ReplicaSet, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsStatefulSetDegradedPredicate ¶
func IsStatefulSetDegradedPredicate(statefulSet *appsv1.StatefulSet, expectedReplicas int) bool
func IsStatefulSetReadyPredicate ¶
func IsStatefulSetReadyPredicate(statefulSet *appsv1.StatefulSet, expectedReplicas int) bool
func ListPods ¶
func ListPods(ctx context.Context, cs *kubernetes.Clientset, namespace, selector string) (*corev1.PodList, error)
ListPods returns the list of currently scheduled or running pods in `namespace` with the given selector
func WaitForPodBySelector ¶
func WaitForPodBySelector(ctx context.Context, cs *kubernetes.Clientset, namespace, selector string, timeout time.Duration) error
WaitForPodBySelector waits up to timeout seconds for all pods in 'namespace' with given 'selector' to enter provided state If no pods are found, return nil.
func WaitForPodReady ¶
func WaitForPodReady(ctx context.Context, cs *kubernetes.Clientset, namespace, podName string, timeout time.Duration) error
WaitForPodReady polls up to timeout seconds for pod to enter steady state (running or succeeded state). Returns an error if the pod never enters a steady state.
func WaitForPodToDisappear ¶
func WaitForPodToDisappear(ctx context.Context, cs *kubernetes.Clientset, namespace, podName string, timeout time.Duration) error
WaitForPodToDisappear polls up to timeout seconds for pod to be gone from the Kubernetes cluster. Returns an error if the pod is never deleted, or if GETing it returns an error other than `NotFound`.
func WaitForReplicaSetSteadyState ¶
func WaitForReplicaSetSteadyState(ctx context.Context, cs *kubernetes.Clientset, namespace, label string, replicaSet *appsv1.ReplicaSet, timeout time.Duration) error
WaitForReplicaSetSteadyState only plays nice with the replicaSet it's being used with. Any pods that might be up still from a previous test may cause unexpected results.
func WaitForReplicaSetToDisappear ¶
func WaitForReplicaSetToDisappear(ctx context.Context, cs *kubernetes.Clientset, namespace, rsName string, timeout time.Duration) error
WaitForReplicaSetToDisappear polls up to timeout seconds for replicaset to be gone from the Kubernetes cluster. Returns an error if the replicaset is never deleted, or if GETing it returns an error other than `NotFound`.
func WaitForStatefulSetGone ¶
func WaitForStatefulSetGone(ctx context.Context, cs *kubernetes.Clientset, namespace, serviceName string, labelSelector string, timeout time.Duration) error
WaitForStatefulSetGone ...
func WaitForZeroIPPoolAllocations ¶
func WaitForZeroIPPoolAllocations(ctx context.Context, k8sIPAM *kubeClient.KubernetesIPAM, ipPoolCIDR string, timeout time.Duration) error
WaitForZeroIPPoolAllocations polls up to timeout seconds for IP pool allocations to be gone from the Kubernetes cluster. Returns an error if any IP pool allocations remain after time limit, or if GETing IP pools causes an error.
Types ¶
type ClientInfo ¶
type ClientInfo struct { Client *kubernetes.Clientset NetClient netclient.K8sCniCncfIoV1Interface WbClient wbclient.Interface }
func NewClientInfo ¶
func NewClientInfo(config *rest.Config) (*ClientInfo, error)
func (*ClientInfo) AddNetAttachDef ¶
func (c *ClientInfo) AddNetAttachDef(netattach *nettypes.NetworkAttachmentDefinition) (*nettypes.NetworkAttachmentDefinition, error)
func (*ClientInfo) DelNetAttachDef ¶
func (c *ClientInfo) DelNetAttachDef(netattach *nettypes.NetworkAttachmentDefinition) error
func (*ClientInfo) DeleteReplicaSet ¶
func (c *ClientInfo) DeleteReplicaSet(replicaSet *appsv1.ReplicaSet) error
func (*ClientInfo) DeleteStatefulSet ¶
func (c *ClientInfo) DeleteStatefulSet(namespace string, serviceName string, labelSelector string) error
func (*ClientInfo) ProvisionPod ¶
func (*ClientInfo) ProvisionReplicaSet ¶
func (c *ClientInfo) ProvisionReplicaSet(rsName string, namespace string, replicaCount int32, labels, annotations map[string]string) (*appsv1.ReplicaSet, error)
func (*ClientInfo) ProvisionStatefulSet ¶
func (c *ClientInfo) ProvisionStatefulSet(statefulSetName string, namespace string, serviceName string, replicas int, networkNames ...string) (*appsv1.StatefulSet, error)
func (*ClientInfo) ScaleStatefulSet ¶
func (c *ClientInfo) ScaleStatefulSet(statefulSetName string, namespace string, deltaInstance int) error
func (*ClientInfo) UpdateReplicaSet ¶
func (c *ClientInfo) UpdateReplicaSet(replicaSet *appsv1.ReplicaSet) (*appsv1.ReplicaSet, error)