func CreateFakeContainer(containerName string) corev1.Container
CreateFakeContainer creates a container with the given containerName
func CreateFakeContainerWithVolumeMounts(containerName string, volumeMounts []corev1.VolumeMount) corev1.Container
CreateFakeContainerWithVolumeMounts creates a container with the given containerName and volumeMounts
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(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(componentName, podName, containerName string) *corev1.Pod
CreateFakePod creates a fake pod with the given pod name and component name
func FakeKubeService(componentName, serviceName string) corev1.Service
func FakeKubeServices(componentName string) []corev1.Service
func FakePVC(pvcName, size string, labels map[string]string) *corev1.PersistentVolumeClaim
func FakeProjects() *v1.ProjectList
FakeProjects returns fake projectlist for use by API mock functions for Unit tests
func GetFakeContainerComponent(name string, ports ...int) v1.Component
GetFakeContainerComponent returns a fake container component for testing
func GetFakeVolumeComponent(name, size string) v1.Component
GetFakeVolumeComponent returns a fake volume component for testing
func GetTestDevfileObj(fs devfilefs.Filesystem) parser.DevfileObj
GetTestDevfileObj returns a devfile object for testing
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(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.
Name | Synopsis |
---|---|
.. | |
filesystem | |
system |