...

Package testingutil

Overview ▾

func CreateFakeContainer

func CreateFakeContainer(containerName string) corev1.Container

CreateFakeContainer creates a container with the given containerName

func CreateFakeContainerWithVolumeMounts

func CreateFakeContainerWithVolumeMounts(containerName string, volumeMounts []corev1.VolumeMount) corev1.Container

CreateFakeContainerWithVolumeMounts creates a container with the given containerName and volumeMounts

func CreateFakeDeployment

func CreateFakeDeployment(podName string, isPartOfComponent bool) *appsv1.Deployment

CreateFakeDeployment creates a fake deployment with the given pod name and labels isPartOfComponent bool decides if the deployment is supposed to be a part of the core resources deployed by `odo dev`

func CreateFakeDeploymentsWithContainers

func CreateFakeDeploymentsWithContainers(podName string, containers []corev1.Container, initContainers []corev1.Container, isPartOfComponent bool) *appsv1.Deployment

CreateFakeDeploymentsWithContainers creates a fake pod with the given pod name, container name and containers isPartOfComponent bool decides if the deployment is supposed to be a part of the core resources deployed by `odo dev`

func CreateFakePod

func CreateFakePod(componentName, podName, containerName string) *corev1.Pod

CreateFakePod creates a fake pod with the given pod name and component name

func FakeKubeService

func FakeKubeService(componentName, serviceName string) corev1.Service

func FakeKubeServices

func FakeKubeServices(componentName string) []corev1.Service

func FakePVC

func FakePVC(pvcName, size string, labels map[string]string) *corev1.PersistentVolumeClaim

func FakeProjects

func FakeProjects() *v1.ProjectList

FakeProjects returns fake projectlist for use by API mock functions for Unit tests

func GetFakeContainerComponent

func GetFakeContainerComponent(name string, ports ...int) v1.Component

GetFakeContainerComponent returns a fake container component for testing

func GetFakeVolumeComponent

func GetFakeVolumeComponent(name, size string) v1.Component

GetFakeVolumeComponent returns a fake volume component for testing

func GetTestDevfileObj

func GetTestDevfileObj(fs devfilefs.Filesystem) parser.DevfileObj

GetTestDevfileObj returns a devfile object for testing

func GetTestDevfileObjFromFile

func GetTestDevfileObjFromFile(fileName string) parser.DevfileObj

GetTestDevfileObjFromFile takes the filename of devfile from tests/examples/source/devfiles/nodejs and returns a parser.DevfileObj

func GetTestDevfileObjWithPreStopEvents

func GetTestDevfileObjWithPreStopEvents(fs devfilefs.Filesystem, preStopId, preStopCMD string) parser.DevfileObj

GetTestDevfileObjWithPreStopEvents returns a devfile object with preStop event. This function can further be extended to accept other type of events.

Subdirectories

Name Synopsis
..
filesystem
system