Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/controller/legendgenerator/legend_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ exit $exit_code;

// Adding config volumemount here to get the same order as in the old ansible operator
initContainer.VolumeMounts = append(initContainer.VolumeMounts, utils.GetConfigVolumeMount(constants.ConfigMapLegendGeneratorVolumeName))
// For mounting the possible stylingfiles that are included
initContainer.VolumeMounts = append(initContainer.VolumeMounts, corev1.VolumeMount{Name: constants.ConfigMapStylingFilesVolumeName, MountPath: "/srv/data/config/styles"})

return &initContainer, nil
}
Expand Down
9 changes: 7 additions & 2 deletions internal/controller/mapserver/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func GetMapserverContainer[O pdoknlv3.WMSWFS](obj O, images types.Images) (*core
},
GetMapfileEnvVar(obj),
},
VolumeMounts: getVolumeMounts(obj.Mapfile() != nil),
VolumeMounts: getVolumeMounts(obj.Mapfile() != nil, obj.Type() == pdoknlv3.ServiceTypeWMS),
Resources: corev1.ResourceRequirements{
Limits: corev1.ResourceList{
corev1.ResourceMemory: resource.MustParse("800M"),
Expand All @@ -61,7 +61,7 @@ func GetMapserverContainer[O pdoknlv3.WMSWFS](obj O, images types.Images) (*core
return &container, nil
}

func getVolumeMounts(customMapfile bool) []corev1.VolumeMount {
func getVolumeMounts(customMapfile bool, wms bool) []corev1.VolumeMount {
volumeMounts := []corev1.VolumeMount{
utils.GetBaseVolumeMount(),
utils.GetDataVolumeMount(),
Expand All @@ -79,6 +79,11 @@ func getVolumeMounts(customMapfile bool) []corev1.VolumeMount {
volumeMounts = append(volumeMounts, utils.GetMapfileVolumeMount())
}

// maps all the found style files for generic SLD inclusion
if wms {
volumeMounts = append(volumeMounts, corev1.VolumeMount{Name: constants.ConfigMapStylingFilesVolumeName, MountPath: "/srv/data/config/styles"})
}

return volumeMounts
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/mapserver/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var expectedVolumeMountsYaml []byte

func TestGetVolumeMounts(t *testing.T) {
pdoknlv3.SetHost("https://service.pdok.nl")
result := getVolumeMounts(false)
result := getVolumeMounts(false, false)

var expectedVolumeMounts struct{ VolumeMounts []corev1.VolumeMount }
err := yaml.Unmarshal(expectedVolumeMountsYaml, &expectedVolumeMounts)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ spec:
- mountPath: /srv/mapserver/config/scraping-error.xml
name: mapserver
subPath: scraping-error.xml
- mountPath: /srv/data/config/styles
name: styling-files
- args:
- --scrape_uri=http://localhost/server-status?auto
image: test.test/image:test7
Expand Down Expand Up @@ -336,6 +338,8 @@ spec:
- mountPath: /input
name: legend-generator-config
readOnly: true
- mountPath: /srv/data/config/styles
name: styling-files
- command:
- /bin/bash
- /input/legend-fixer.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ spec:
subPath: scraping-error.xml
- name: mapfile
mountPath: /srv/data/config/mapfile
- mountPath: /srv/data/config/styles
name: styling-files
- args:
- --scrape_uri=http://localhost/server-status?auto
image: test.test/image:test7
Expand Down Expand Up @@ -305,6 +307,8 @@ spec:
- mountPath: /input
name: legend-generator-config
readOnly: true
- mountPath: /srv/data/config/styles
name: styling-files
terminationGracePeriodSeconds: 60
volumes:
- emptyDir: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ spec:
- mountPath: /srv/mapserver/config/scraping-error.xml
name: mapserver
subPath: scraping-error.xml
- mountPath: /srv/data/config/styles
name: styling-files
- args:
- --scrape_uri=http://localhost/server-status?auto
image: test.test/image:test7
Expand Down Expand Up @@ -323,6 +325,8 @@ spec:
- mountPath: /input
name: legend-generator-config
readOnly: true
- mountPath: /srv/data/config/styles
name: styling-files
terminationGracePeriodSeconds: 60
volumes:
- emptyDir: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ spec:
- mountPath: /srv/mapserver/config/scraping-error.xml
name: mapserver
subPath: scraping-error.xml
- mountPath: /srv/data/config/styles
name: styling-files
- args:
- --scrape_uri=http://localhost/server-status?auto
image: test.test/image:test7
Expand Down Expand Up @@ -319,6 +321,8 @@ spec:
- mountPath: /input
name: legend-generator-config
readOnly: true
- mountPath: /srv/data/config/styles
name: styling-files
terminationGracePeriodSeconds: 60
volumes:
- emptyDir: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ spec:
- mountPath: /srv/mapserver/config/scraping-error.xml
name: mapserver
subPath: scraping-error.xml
- mountPath: /srv/data/config/styles
name: styling-files
- args:
- "patch"
image: patch.patch/image:patch
Expand Down Expand Up @@ -328,6 +330,8 @@ spec:
- mountPath: /input
name: legend-generator-config
readOnly: true
- mountPath: /srv/data/config/styles
name: styling-files
terminationGracePeriodSeconds: 600
volumes:
- emptyDir: {}
Expand Down