Skip to content

Commit 99685e6

Browse files
Merge pull request #21 from PDOK/pdok-17792-wms-operator-unittest
Pdok 17792 wms operator unittest
2 parents 7c0707f + 0bc49f0 commit 99685e6

File tree

4 files changed

+328
-69
lines changed

4 files changed

+328
-69
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: mapserver.ConfigMapStylingFilesVolumeName, 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: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const (
2222
ConfigMapOgcWebserviceProxyVolumeName = "ogc-webservice-proxy-config"
2323
ConfigMapLegendGeneratorVolumeName = "legend-generator-config"
2424
ConfigMapFeatureinfoGeneratorVolumeName = "featureinfo-generator-config"
25+
ConfigMapStylingFilesVolumeName = "styling-files"
2526
// TODO How should we determine this boundingbox?
2627
healthCheckBbox = "190061.4619730016857,462435.5987861062749,202917.7508707302331,473761.6884966178914"
2728

@@ -89,7 +90,7 @@ func GetVolumesForDeployment[O pdoknlv3.WMSWFS](obj O, configMapNames types.Hash
8990
if mapfile := obj.Mapfile(); mapfile != nil {
9091
volumes = append(volumes, v1.Volume{
9192
Name: "mapfile",
92-
VolumeSource: newVolumeSource(mapfile.ConfigMapKeyRef.Name),
93+
VolumeSource: newVolumeSource(mapfile.ConfigMapKeyRef.Key),
9394
})
9495
}
9596

@@ -102,7 +103,30 @@ func GetVolumesForDeployment[O pdoknlv3.WMSWFS](obj O, configMapNames types.Hash
102103
Name: ConfigMapFeatureinfoGeneratorVolumeName,
103104
VolumeSource: newVolumeSource(configMapNames.FeatureInfoGenerator),
104105
}
105-
volumes = append(volumes, lgVolume, figVolume)
106+
stylingFilesVolume := v1.Volume{
107+
Name: ConfigMapStylingFilesVolumeName,
108+
VolumeSource: v1.VolumeSource{
109+
Projected: &v1.ProjectedVolumeSource{
110+
Sources: []v1.VolumeProjection{
111+
{
112+
ConfigMap: &v1.ConfigMapProjection{
113+
LocalObjectReference: v1.LocalObjectReference{
114+
Name: "gpkg-styling",
115+
},
116+
},
117+
},
118+
{
119+
ConfigMap: &v1.ConfigMapProjection{
120+
LocalObjectReference: v1.LocalObjectReference{
121+
Name: "tif-styling",
122+
},
123+
},
124+
},
125+
},
126+
},
127+
},
128+
}
129+
volumes = append(volumes, lgVolume, figVolume, stylingFilesVolume)
106130
}
107131

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

internal/controller/ogcwebserviceproxy/ogc_webservice_proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func GetOgcWebserviceProxyContainer(wms *pdoknlv3.WMS, image string) (*corev1.Co
1616
Ports: []corev1.ContainerPort{{ContainerPort: 9111}},
1717
Command: getCommand(wms),
1818
VolumeMounts: []corev1.VolumeMount{
19-
{Name: mapserver.ConfigMapOgcWebserviceProxyVolumeName, MountPath: "/input", ReadOnly: false},
19+
{Name: mapserver.ConfigMapOgcWebserviceProxyVolumeName, MountPath: "/input", ReadOnly: true},
2020
},
2121
Resources: corev1.ResourceRequirements{
2222
Limits: corev1.ResourceList{

0 commit comments

Comments
 (0)