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

Method addVolume

test/v200/utils/common/component_test_utils.go:44–53  ·  view source on GitHub ↗

addVolume returns volumeMounts in a schema structure based on a specified number of volumes

(numVols int)

Source from the content-addressed store, hash-verified

42
43// addVolume returns volumeMounts in a schema structure based on a specified number of volumes
44func (devfile *TestDevfile) addVolume(numVols int) []schema.VolumeMount {
45 commandVols := make([]schema.VolumeMount, numVols)
46 for i := 0; i < numVols; i++ {
47 volumeComponent := devfile.AddComponent(schema.VolumeComponentType)
48 commandVols[i].Name = volumeComponent.Name
49 commandVols[i].Path = "/Path_" + GetRandomString(5, false)
50 LogInfoMessage(fmt.Sprintf("....... Add Volume: %s", commandVols[i]))
51 }
52 return commandVols
53}
54
55// AddComponent adds a component of the specified type, with random attributes, to the devfile schema
56func (devfile *TestDevfile) AddComponent(componentType schema.ComponentType) schema.Component {

Callers 1

Calls 3

AddComponentMethod · 0.95
GetRandomStringFunction · 0.85
LogInfoMessageFunction · 0.85

Tested by

no test coverage detected