utils

package
v0.31.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package utils contails utilities useful in the context of E2E tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKustomizationOverlay added in v0.18.0

func CreateKustomizationOverlay(namespace, kustomizeYamlFileDir, overlayDir string) error

CreateKustomizationOverlay copies the base overlay, and changes the namespace and relative paths to resources. The deletion of the files is left for the caller.

func DeployWebhook added in v0.22.0

func DeployWebhook(ctx context.Context, f *framework.Framework, kustomizationPath string) v1.Pod

DeployWebhook deploys an admission webhook to a framework-specific namespace.

func GetPodLogs added in v0.28.0

func GetPodLogs(ctx context.Context, f *framework.Framework, podName, containerName string) string

GetPodLogs returns the log of the container. If not possible to get logs, it returns the error message.

func Kubectl added in v0.26.0

func Kubectl(ns string, cmd string, opt string, file string)

func LocateRepoFile

func LocateRepoFile(repopath string) (string, error)

LocateRepoFile locates a file inside this repository.

func TestContainersRunAsNonRoot added in v0.22.0

func TestContainersRunAsNonRoot(pods []v1.Pod) error

TestContainersRunAsNonRoot checks that all containers within the Pods run with non-root UID/GID.

func TestPodsFileSystemInfo added in v0.22.0

func TestPodsFileSystemInfo(pods []v1.Pod) error

TestPodsFileSystemInfo checks that all containers within the Pods run with ReadOnlyRootFileSystem. It also prints RW volume mounts.

func TestWebhookServerTLS added in v0.25.0

func TestWebhookServerTLS(ctx context.Context, f *framework.Framework, serviceName string) error

func WaitForNodesWithResource

func WaitForNodesWithResource(ctx context.Context, c clientset.Interface, res v1.ResourceName, timeout time.Duration, waitForResourceFunc WaitForResourceFunc) error

WaitForNodesWithResource waits for node's resources to change. Depending on the waitOperation, function waits for positive resource count or a zero resource count.

func WaitForPodFailure added in v0.18.0

func WaitForPodFailure(ctx context.Context, f *framework.Framework, name string, timeout time.Duration)

WaitForPodFailure waits for a pod to fail. This function used to be a part of k8s e2e framework, but was deleted in https://github.com/kubernetes/kubernetes/pull/86732.

func WaitForPositiveResource added in v0.31.0

func WaitForPositiveResource(resourceCount int) bool

func WaitForZeroResource added in v0.31.0

func WaitForZeroResource(resourceCount int) bool

Types

type WaitForResourceFunc added in v0.31.0

type WaitForResourceFunc func(resourceCount int) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL