Documentation ¶
Index ¶
- Variables
- func ConsistentlyPodRunning(c client.Client, ctx context.Context, namespace, name string) AsyncAssertion
- func EventuallyPodContainerRestart(c client.Client, ctx context.Context, namespace, name string) AsyncAssertion
- func EventuallyPodDeleted(c client.Client, ctx context.Context, namespace, name string) AsyncAssertion
- func EventuallyPodRunning(c client.Client, ctx context.Context, namespace, name string) AsyncAssertion
- func GinkgoNodeId() string
- func RandomString() string
- type TestK8SClient
- func (c *TestK8SClient) DeleteAllInNamespace(ctx context.Context, namespace string, obj client.Object)
- func (c *TestK8SClient) DeleteFluentPVC(ctx context.Context, name string)
- func (c *TestK8SClient) DeleteNamespace(ctx context.Context, name string)
- func (c *TestK8SClient) Find(ctx context.Context, obj client.Object)
- func (c *TestK8SClient) FindOrCreate(ctx context.Context, obj client.Object, opts ...client.CreateOption)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TestContainerSleepInf *corev1.Container = &corev1.Container{ Name: testContainerNamePrefix + "sleep-inf", Args: []string{"sleep", "inf"}, Image: "krallin/ubuntu-tini:trusty", } TestSidecarContainerEcho *corev1.Container = &corev1.Container{ Name: testSidecarContainerNamePrefix + "echo", Command: []string{"sh", "-c", "sleep 10; echo sidecar"}, Image: "alpine", } TestSidecarContainerExit1 *corev1.Container = &corev1.Container{ Name: testSidecarContainerNamePrefix + "exit1", Command: []string{"sh", "-c", "sleep 10; exit 1"}, Image: "alpine", } TestFinalizerContainerEcho *corev1.Container = &corev1.Container{ Name: testFinalizerContainerNamePrefix + "echo", Command: []string{"sh", "-c", "sleep 10; echo finalizer"}, Image: "alpine", } TestDefaultPod *corev1.Pod = &corev1.Pod{ TypeMeta: metav1.TypeMeta{ APIVersion: corev1.SchemeGroupVersion.String(), Kind: "Pod", }, Spec: corev1.PodSpec{ Containers: []corev1.Container{*TestContainerSleepInf.DeepCopy()}, }, } TestDefaultFluentPVC *fluentpvcv1alpha1.FluentPVC = &fluentpvcv1alpha1.FluentPVC{ TypeMeta: metav1.TypeMeta{ APIVersion: fluentpvcv1alpha1.GroupVersion.String(), Kind: "FluentPVC", }, Spec: fluentpvcv1alpha1.FluentPVCSpec{ PVCSpecTemplate: corev1.PersistentVolumeClaimSpec{ AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}, Resources: corev1.ResourceRequirements{ Requests: map[corev1.ResourceName]resource.Quantity{ corev1.ResourceStorage: resource.MustParse("1Gi"), }, }, StorageClassName: func(s string) *string { return &s }("standard"), }, PVCVolumeName: "test-volume", PVCVolumeMountPath: "/mnt/test", CommonEnvs: []corev1.EnvVar{}, SidecarContainerTemplate: *TestSidecarContainerEcho.DeepCopy(), DeletePodIfSidecarContainerTerminationDetected: true, PVCFinalizerJobSpecTemplate: batchv1.JobSpec{ BackoffLimit: pointer.Int32Ptr(0), Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ RestartPolicy: corev1.RestartPolicyNever, Containers: []corev1.Container{ *TestFinalizerContainerEcho.DeepCopy(), }, }, }, }, }, } )
Functions ¶
func ConsistentlyPodRunning ¶
func EventuallyPodDeleted ¶
func EventuallyPodRunning ¶
func GinkgoNodeId ¶
func GinkgoNodeId() string
func RandomString ¶
func RandomString() string
Types ¶
type TestK8SClient ¶
func NewTestK8SClient ¶
func NewTestK8SClient(c client.Client) *TestK8SClient
func (*TestK8SClient) DeleteAllInNamespace ¶
func (*TestK8SClient) DeleteFluentPVC ¶
func (c *TestK8SClient) DeleteFluentPVC(ctx context.Context, name string)
func (*TestK8SClient) DeleteNamespace ¶
func (c *TestK8SClient) DeleteNamespace(ctx context.Context, name string)
func (*TestK8SClient) FindOrCreate ¶
func (c *TestK8SClient) FindOrCreate(ctx context.Context, obj client.Object, opts ...client.CreateOption)
Click to show internal directories.
Click to hide internal directories.