MCPcopy Create free account
hub / github.com/devfile/api / generateDummyContainerComponent

Function generateDummyContainerComponent

pkg/validation/components_test.go:30–48  ·  view source on GitHub ↗

generateDummyContainerComponent returns a dummy container component for testing

(name string, volMounts []v1alpha2.VolumeMount, endpoints []v1alpha2.Endpoint, envs []v1alpha2.EnvVar, annotation v1alpha2.Annotation, dedicatedPod bool)

Source from the content-addressed store, hash-verified

28
29// generateDummyContainerComponent returns a dummy container component for testing
30func generateDummyContainerComponent(name string, volMounts []v1alpha2.VolumeMount, endpoints []v1alpha2.Endpoint, envs []v1alpha2.EnvVar, annotation v1alpha2.Annotation, dedicatedPod bool) v1alpha2.Component {
31 image := "docker.io/maven:latest"
32 mountSources := true
33
34 return v1alpha2.Component{
35 Name: name,
36 ComponentUnion: v1alpha2.ComponentUnion{
37 Container: &v1alpha2.ContainerComponent{
38 Container: v1alpha2.Container{
39 Image: image,
40 Annotation: &annotation,
41 Env: envs,
42 VolumeMounts: volMounts,
43 MountSources: &mountSources,
44 DedicatedPod: &dedicatedPod,
45 },
46 Endpoints: endpoints,
47 }}}
48}
49
50// generateDummyContainerComponentWithResourceRequirement returns a dummy container component with resource requirement for testing
51func generateDummyContainerComponentWithResourceRequirement(name, memoryLimit, memoryRequest, cpuLimit, cpuRequest string) v1alpha2.Component {

Callers 4

TestValidateCommandsFunction · 0.85
TestValidateComponentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected