Documentation
¶
Index ¶
- func DeleteConfigMap(client client.Client, name, namespace string) (err error)
- func DeletePersistentVolume(client client.Client, name string) (err error)
- func DeletePersistentVolumeClaim(client client.Client, name, namespace string) (err error)
- func DeletePod(client client.Client, pod *corev1.Pod) error
- func EnsureNamespace(client client.Client, namespace string) (err error)
- func ExcludeInactivePod(pod *v1.Pod) bool
- func ExecCommandInContainer(podName string, containerName string, namespace string, cmd []string) (stdout string, stderr string, err error)
- func ExecCommandInContainerWithFullOutput(podName string, containerName string, namespace string, cmd []string) (stdout string, stderr string, err error)
- func ExecCommandInPod(podName string, namespace string, cmd []string) (stdout string, stderr string, err error)
- func ExecShellInContainer(podName string, containerName string, namespace string, cmd string) (stdout string, stderr string, err error)
- func ExecWithOptions(options ExecOptions) (string, string, error)
- func GetNode(client client.Client, name string) (node *v1.Node, err error)
- func GetPodByName(client client.Client, name, namespace string) (pod *corev1.Pod, err error)
- func GetPodPvcs(volumes []v1.Volume) []v1.Volume
- func GetPvcMountPods(e client.Client, pvcName, namespace string) ([]v1.Pod, error)
- func GetServiceByName(client client.Client, name, namespace string) (service *corev1.Service, err error)
- func IsCompletePod(pod *corev1.Pod) bool
- func IsConfigMapExist(client client.Client, name, namespace string) (found bool, err error)
- func IsFailedPod(pod *corev1.Pod) bool
- func IsPersistentVolumeClaimExist(client client.Client, name, namespace string, annotations map[string]string) (found bool, err error)
- func IsPersistentVolumeExist(client client.Client, name string, annotations map[string]string) (found bool, err error)
- func IsReady(node v1.Node) (ready bool)
- func RemoveProtectionFinalizer(client client.Client, name, namespace string) (err error)
- func ShouldRemoveProtectionFinalizer(client client.Client, name, namespace string) (should bool, err error)
- type ExecOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteConfigMap ¶
Delete the configmap given its name and namespace if the configmap exists
func DeletePersistentVolume ¶
DeletePersistentVolume deletes volume
func DeletePersistentVolumeClaim ¶
DeletePersistentVolumeClaim deletes volume claim
func EnsureNamespace ¶
Make sure the namespace exist
func ExcludeInactivePod ¶ added in v0.4.0
exclude Inactive pod when compute ports
func ExecCommandInContainer ¶
func ExecCommandInContainer(podName string, containerName string, namespace string, cmd []string) (stdout string, stderr string, err error)
A wrapper function of ExecCommandInContainerWithFullOutput
func ExecCommandInContainerWithFullOutput ¶
func ExecCommandInContainerWithFullOutput(podName string, containerName string, namespace string, cmd []string) (stdout string, stderr string, err error)
ExecCommandInContainerWithFullOutput executes a command in the specified container and return stdout, stderr and error
func ExecCommandInPod ¶
func ExecCommandInPod(podName string, namespace string, cmd []string) (stdout string, stderr string, err error)
Find the first container in the given pod, executes command in that container, and return stdout, stderr and error.
func ExecShellInContainer ¶
func ExecShellInContainer(podName string, containerName string, namespace string, cmd string) (stdout string, stderr string, err error)
Execute shell command or script in the specified container and return stdout, stderr and error
func ExecWithOptions ¶
func ExecWithOptions(options ExecOptions) (string, string, error)
ExecWithOptions executes a command in the specified container, returning stdout, stderr and error. `options` allowed for additional parameters to be passed.
func GetPodByName ¶
GetPodByName gets pod with given name and namespace of the pod.
func GetPodPvcs ¶
GetPodPvcs get PersistVolumeClaims of pod
func GetPvcMountPods ¶
GetPvcMountPods get pods that mounted the specific pvc for a given namespace
func GetServiceByName ¶ added in v0.4.0
func GetServiceByName(client client.Client, name, namespace string) (service *corev1.Service, err error)
get service given name and namespace of the service.
func IsCompletePod ¶
IsCompletePod determines if the pod is complete
func IsConfigMapExist ¶
Check if the configMap exists given its name and namespace
func IsFailedPod ¶
IsFailedPod determines if the pod is failed
func IsPersistentVolumeClaimExist ¶
func IsPersistentVolumeClaimExist(client client.Client, name, namespace string, annotations map[string]string) (found bool, err error)
IsPersistentVolumeClaimExist checks if the persistent volume claim exists given name, namespace and annotations of the PVC.
func IsPersistentVolumeExist ¶
func IsPersistentVolumeExist(client client.Client, name string, annotations map[string]string) (found bool, err error)
IsPersistentVolumeExist checks if the persistent volume exists given name and annotations of the PV.
func IsReady ¶
func IsReady(node v1.Node) (ready bool)
IsReady checks if the node is ready If the node is ready,it returns True.Otherwise,it returns False.
func RemoveProtectionFinalizer ¶
RemoveProtectionFinalizer remove finalizers of PersistentVolumeClaim if all owners that this PVC is mounted by are inactive (Succeed or Failed)