addVolume returns volumeMounts in a schema structure based on a specified number of volumes
(numVols int)
| 42 | |
| 43 | // addVolume returns volumeMounts in a schema structure based on a specified number of volumes |
| 44 | func (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 |
| 56 | func (devfile *TestDevfile) AddComponent(componentType schema.ComponentType) schema.Component { |
no test coverage detected