testingutil

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFakeContainer

func CreateFakeContainer(containerName string) corev1.Container

CreateFakeContainer creates a container with the given containerName

func FakeResourceRequirements

func FakeResourceRequirements(cpu, memory string) (corev1.ResourceRequirements, error)

FakeResourceRequirements creates a fake resource requirements from cpu and memory

func GenerateDummyContainerComponent

func GenerateDummyContainerComponent(name string, volMounts []v1.VolumeMount, endpoints []v1.Endpoint, envs []v1.EnvVar, annotation v1.Annotation, dedicatedPod *bool) v1.Component

GenerateDummyContainerComponent returns a dummy container component for testing

func GetDockerImageTestComponent

func GetDockerImageTestComponent(div DockerImageValues, autobuild *bool, attr attributes.Attributes) v1.Component

GetDockerImageTestComponent returns a docker image component that is used for testing. The parameters allow customization of the content. If they are set to nil, then the properties will not be set

func GetDockerImageTestComponentParentOverride

func GetDockerImageTestComponentParentOverride(div DockerImageValues) v1.ComponentParentOverride

GetDockerImageTestComponentParentOverride returns a docker image parent override component that is used for testing. The parameters allow customization of the content. If they are set to nil, then the properties will not be set

func GetDockerImageTestComponentPluginOverride

func GetDockerImageTestComponentPluginOverride(div DockerImageValues) v1.ComponentPluginOverride

GetDockerImageTestComponentPluginOverride returns a docker image parent override component that is used for testing. The parameters allow customization of the content. If they are set to nil, then the properties will not be set

func GetFakeContainerComponent

func GetFakeContainerComponent(name string) v1.Component

GetFakeContainerComponent returns a fake container component for testing. Deprecated: use GenerateDummyContainerComponent instead

func GetFakeEnv

func GetFakeEnv(name, value string) v1.EnvVar

GetFakeEnv returns a fake env for testing

func GetFakeEnvParentOverride

func GetFakeEnvParentOverride(name, value string) v1.EnvVarParentOverride

GetFakeEnvParentOverride returns a fake envParentOverride for testing

func GetFakeExecRunCommands

func GetFakeExecRunCommands() []v1.ExecCommand

GetFakeExecRunCommands returns fake commands for testing

func GetFakeVolumeComponent

func GetFakeVolumeComponent(name, size string) v1.Component

GetFakeVolumeComponent returns a fake volume component for testing

func GetFakeVolumeMount

func GetFakeVolumeMount(name, path string) v1.VolumeMount

GetFakeVolumeMount returns a fake volume mount for testing

func GetFakeVolumeMountParentOverride

func GetFakeVolumeMountParentOverride(name, path string) v1.VolumeMountParentOverride

GetFakeVolumeMountParentOverride returns a fake volumeMountParentOverride for testing

Types

type DockerImageValues

type DockerImageValues struct {
	//maps to Image.ImageName
	ImageName string
	//maps to Image.Dockerfile.DockerfileSrc.Uri
	Uri string
	//maps to Image.Dockerfile.BuildContext
	BuildContext string
	//maps to Image.Dockerfile.RootRequired
	RootRequired *bool
}

DockerImageValues struct can be used to set override or main component struct values

type FakeK8sClient

type FakeK8sClient struct {
	client.Client         // To satisfy interface; override all used methods
	DevWorkspaceResources map[string]v1alpha2.DevWorkspaceTemplate
	Errors                map[string]string
	ExpectedNamespace     string
}

func (*FakeK8sClient) Get

func (client *FakeK8sClient) Get(_ context.Context, namespacedName client.ObjectKey, obj client.Object, _ ...client.GetOption) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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