Skip to content

Commit a89353c

Browse files
authored
fix: the latter volume dirs overwrite the prior one (#1214)
1 parent 2c90454 commit a89353c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/modules/generators/workload/workload_generator.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ func toOrderedContainers(
9898

9999
// Create a slice of volumes and configMaps based on the containers' files to be created.
100100
var volumes []corev1.Volume
101-
var volumeMounts []corev1.VolumeMount
102101
var configMaps []corev1.ConfigMap
103102

104103
if err := modules.ForeachOrdered(appContainers, func(containerName string, c v1.Container) error {
@@ -128,10 +127,12 @@ func toOrderedContainers(
128127
}
129128

130129
// Append the configMap, volume and volumeMount objects into the corresponding slices.
131-
volumes, volumeMounts, configMaps, err = handleFileCreation(c, uniqueAppName, containerName)
130+
volumesContainer, volumeMounts, configMapsContainer, err := handleFileCreation(c, uniqueAppName, containerName)
132131
if err != nil {
133132
return err
134133
}
134+
volumes = append(volumes, volumesContainer...)
135+
configMaps = append(configMaps, configMapsContainer...)
135136
ctn.VolumeMounts = append(ctn.VolumeMounts, volumeMounts...)
136137

137138
// Append more volumes and volumeMounts

0 commit comments

Comments
 (0)