Skip to content

Commit c4e429f

Browse files
committed
PDOK-17792 VolumeAmount styling-files toevoegen
1 parent cc4627e commit c4e429f

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

internal/controller/mapfilegenerator/mapfile_generator.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ func GetMapfileGeneratorInitContainer[O pdoknlv3.WMSWFS](obj O, image, postgisCo
3030
},
3131
}
3232

33+
if obj.Type() == pdoknlv3.ServiceTypeWMS {
34+
stylingFilesVolAm := corev1.VolumeMount{Name: "styling-files", MountPath: "/styling", ReadOnly: true}
35+
initContainer.VolumeMounts = append(initContainer.VolumeMounts, stylingFilesVolAm)
36+
}
3337
// Additional mapfile-generator configuration
3438
if obj.HasPostgisData() {
3539
initContainer.EnvFrom = []corev1.EnvFromSource{

internal/controller/mapserver/deployment.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,30 @@ func GetVolumesForDeployment[O pdoknlv3.WMSWFS](obj O, configMapNames types.Hash
117117
},
118118
},
119119
}
120-
volumes = append(volumes, lgVolume, figVolume)
120+
stylingFilesVolume := v1.Volume{
121+
Name: "styling-files",
122+
VolumeSource: v1.VolumeSource{
123+
Projected: &v1.ProjectedVolumeSource{
124+
Sources: []v1.VolumeProjection{
125+
{
126+
ConfigMap: &v1.ConfigMapProjection{
127+
LocalObjectReference: v1.LocalObjectReference{
128+
Name: "gpkg-styling",
129+
},
130+
},
131+
},
132+
{
133+
ConfigMap: &v1.ConfigMapProjection{
134+
LocalObjectReference: v1.LocalObjectReference{
135+
Name: "tif-styling",
136+
},
137+
},
138+
},
139+
},
140+
},
141+
},
142+
}
143+
volumes = append(volumes, lgVolume, figVolume, stylingFilesVolume)
121144
}
122145

123146
if options := obj.Options(); options != nil {

internal/controller/wms_controller_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,15 @@ var _ = Describe("WMS Controller", func() {
278278
Expect(blobDownloadContainer.VolumeMounts).Should(Equal(volumeMounts))
279279
Expect(blobDownloadContainer.EnvFrom).Should(Equal(envFrom))
280280
Expect(blobDownloadContainer.Command).Should(Equal([]string{"/bin/sh", "-c"}))
281-
Expect(len(blobDownloadContainer.Args)).Should(BeNumerically(">", 0))
281+
Expect(len(blobDownloadContainer.Args)).Should(BeNumerically("==", 1))
282282

283283
mapfileGeneratorContainer, err := getInitContainer("mapfile-generator", deployment)
284284
Expect(err).NotTo(HaveOccurred())
285285
Expect(mapfileGeneratorContainer.Image).Should(Equal(reconcilerImages.MapfileGeneratorImage))
286286
volumeMounts = []v1.VolumeMount{
287287
{Name: "base", MountPath: "/srv/data"},
288288
{Name: mapserver.ConfigMapMapfileGeneratorVolumeName, MountPath: "/input", ReadOnly: true},
289+
{Name: "styling-files", MountPath: "/styling", ReadOnly: true},
289290
}
290291
Expect(mapfileGeneratorContainer.VolumeMounts).Should(Equal(volumeMounts))
291292
Expect(mapfileGeneratorContainer.Command).Should(Equal([]string{"generate-mapfile"}))

0 commit comments

Comments
 (0)