containerized-data-importer/tests/framework/pod.go
j-griffith 0a84e2fa8c Add lint checks to remaining go src directories
This finishes up the last of the golint implementation, with the
addition of the cmd, tests and tools directories we are now running
golint tests on all of the current go source files in the project.

This change adds all the little fixes (mostly just commenting and
naming) and also enables the new diretories in the lint test that we
gate on.
2018-09-29 08:35:21 -06:00

36 lines
1.3 KiB
Go

package framework
import (
"time"
k8sv1 "k8s.io/api/core/v1"
"kubevirt.io/containerized-data-importer/pkg/common"
"kubevirt.io/containerized-data-importer/tests/utils"
)
// CreatePod is a wrapper around utils.CreatePod
func (f *Framework) CreatePod(podDef *k8sv1.Pod) (*k8sv1.Pod, error) {
return utils.CreatePod(f.K8sClient, f.Namespace.Name, podDef)
}
// DeletePod is a wrapper around utils.DeletePod
func (f *Framework) DeletePod(pod *k8sv1.Pod) error {
return utils.DeletePod(f.K8sClient, pod, f.Namespace.Name)
}
// WaitTimeoutForPodReady is a wrapper around utils.WaitTimeouotForPodReady
func (f *Framework) WaitTimeoutForPodReady(podName string, timeout time.Duration) error {
return utils.WaitTimeoutForPodReady(f.K8sClient, podName, f.Namespace.Name, timeout)
}
// WaitTimeoutForPodStatus is a wrapper around utils.WaitTimeouotForPodStatus
func (f *Framework) WaitTimeoutForPodStatus(podName string, status k8sv1.PodPhase, timeout time.Duration) error {
return utils.WaitTimeoutForPodStatus(f.K8sClient, podName, f.Namespace.Name, status, timeout)
}
// FindPodByPrefix is a wrapper around utils.FindPodByPrefix
func (f *Framework) FindPodByPrefix(prefix string) (*k8sv1.Pod, error) {
return utils.FindPodByPrefix(f.K8sClient, f.Namespace.Name, prefix, common.CDILabelSelector)
}