Documentation ¶
Index ¶
- type Framework
- func (f *Framework) CreateDummyPodObjectWithPrefix(prefix string, images ...string) *corev1.Pod
- func (f *Framework) CreatePod(pod *corev1.Pod) (*corev1.Pod, error)
- func (f *Framework) DeletePod(namespace, name string) error
- func (f *Framework) DeletePodImmediately(namespace, name string) error
- func (f *Framework) GetStatsSummary() (*stats.Summary, error)
- func (f *Framework) WaitUntilPodCondition(namespace, name string, fn watch.ConditionFunc) error
- func (f *Framework) WaitUntilPodDeleted(namespace, name string) error
- func (f *Framework) WaitUntilPodReady(namespace, name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Framework ¶
type Framework struct { KubeClient kubernetes.Interface Namespace string NodeName string TaintKey string TaintValue string TaintEffect string }
Framework encapsulates the configuration for the current run, and provides helper methods to be used during testing.
func NewTestingFramework ¶
func NewTestingFramework(kubeconfig, namespace, nodeName, taintKey, taintValue, taintEffect string) *Framework
NewTestingFramework returns a new instance of the testing framework.
func (*Framework) CreateDummyPodObjectWithPrefix ¶
CreateDummyPodObjectWithPrefix creates a dujmmy pod object using the specified prefix as the value of .metadata.generateName. A variable number of strings can be provided. For each one of these strings, a container that uses the string as its image will be appended to the pod. This method DOES NOT create the pod in the Kubernetes API.
func (*Framework) DeletePod ¶
DeletePod deletes the pod with the specified name and namespace in the Kubernetes API using the default grace period.
func (*Framework) DeletePodImmediately ¶
DeletePodImmediately forcibly deletes the pod with the specified name and namespace in the Kubernetes API. This is equivalent to running "kubectl delete --force --grace-period 0 --namespace <namespace> pod <name>".
func (*Framework) GetStatsSummary ¶
GetStatsSummary queries the /stats/summary endpoint of the virtual-kubelet and returns the Summary object obtained as a response.
func (*Framework) WaitUntilPodCondition ¶
func (f *Framework) WaitUntilPodCondition(namespace, name string, fn watch.ConditionFunc) error
WaitUntilPodCondition establishes a watch on the pod with the specified name and namespace. Then, it waits for the specified condition function to be verified.
func (*Framework) WaitUntilPodDeleted ¶
WaitUntilPodDeleted blocks until the pod with the specified name and namespace is marked for deletion (or, alternatively, effectively deleted).
func (*Framework) WaitUntilPodReady ¶
WaitUntilPodReady blocks until the pod with the specified name and namespace is reported to be running and ready.