Skip to content

Commit c144622

Browse files
authored
Merge pull request #113 from PDOK/fix_readonly_gpkgs
Set GPKG's to read-only explicitly, instead of the base volume.
2 parents 64f8e02 + 2d7c779 commit c144622

File tree

23 files changed

+32
-30
lines changed

23 files changed

+32
-30
lines changed

internal/controller/blobdownload/blob_download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func GetBlobDownloadInitContainer[O pdoknlv3.WMSWFS](obj O, images types.Images)
6363
},
6464
Command: []string{"/bin/sh", "-c"},
6565
VolumeMounts: []corev1.VolumeMount{
66-
utils.GetBaseVolumeMount(false),
66+
utils.GetBaseVolumeMount(),
6767
utils.GetDataVolumeMount(),
6868
},
6969
}

internal/controller/blobdownload/gpkg_download.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ function download() {
103103
echo "No hash found for $file in blob storage, skipping checksum."
104104
fi
105105

106+
# After successful download set the GPKG to readonly
107+
chmod -wx $file
106108
echo "done"
107109
}
108110

internal/controller/featureinfogenerator/featureinfo_generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func GetFeatureinfoGeneratorInitContainer(images types.Images) (*corev1.Containe
2727
"feature-info",
2828
},
2929
VolumeMounts: []corev1.VolumeMount{
30-
utils.GetBaseVolumeMount(false),
30+
utils.GetBaseVolumeMount(),
3131
utils.GetConfigVolumeMount(constants.ConfigMapFeatureinfoGeneratorVolumeName),
3232
},
3333
}

internal/controller/legendgenerator/legend_generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ exit $exit_code;
4040
`,
4141
},
4242
VolumeMounts: []corev1.VolumeMount{
43-
utils.GetBaseVolumeMount(false),
43+
utils.GetBaseVolumeMount(),
4444
utils.GetDataVolumeMount(),
4545
{Name: constants.MapserverName, MountPath: "/srv/mapserver/config/default_mapserver.conf", SubPath: "default_mapserver.conf"},
4646
},

internal/controller/mapfilegenerator/mapfile_generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func GetMapfileGeneratorInitContainer[O pdoknlv3.WMSWFS](obj O, images types.Ima
2828
"/srv/data/config/mapfile",
2929
},
3030
VolumeMounts: []corev1.VolumeMount{
31-
utils.GetBaseVolumeMount(false),
31+
utils.GetBaseVolumeMount(),
3232
utils.GetConfigVolumeMount(constants.ConfigMapMapfileGeneratorVolumeName),
3333
},
3434
}

internal/controller/mapserver/deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func GetMapserverContainer[O pdoknlv3.WMSWFS](obj O, images types.Images) (*core
6363

6464
func getVolumeMounts(customMapfile bool) []corev1.VolumeMount {
6565
volumeMounts := []corev1.VolumeMount{
66-
utils.GetBaseVolumeMount(true),
66+
utils.GetBaseVolumeMount(),
6767
utils.GetDataVolumeMount(),
6868
}
6969

internal/controller/mapserver/test_data/expected_volumemounts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
volumeMounts:
22
- mountPath: /srv/data
33
name: base
4-
readOnly: true
4+
readOnly: false
55
- mountPath: /var/www
66
name: data
77
- mountPath: /srv/mapserver/config/include.conf

internal/controller/test_data/wfs/complete/expected/configmap-init-scripts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ metadata:
179179
service-type: wfs
180180
service-version: v1_0
181181
theme: theme
182-
name: complete-wfs-init-scripts-fft29bbtdd
182+
name: complete-wfs-init-scripts-f8k8ffgmgh
183183
namespace: default
184184
ownerReferences:
185185
- apiVersion: pdok.nl/v3

internal/controller/test_data/wfs/complete/expected/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ spec:
126126
volumeMounts:
127127
- mountPath: /srv/data
128128
name: base
129-
readOnly: true
129+
readOnly: false
130130
- mountPath: /var/www
131131
name: data
132132
readOnly: false
@@ -258,7 +258,7 @@ spec:
258258
name: mapserver
259259
- configMap:
260260
defaultMode: 511
261-
name: complete-wfs-init-scripts-fft29bbtdd
261+
name: complete-wfs-init-scripts-f8k8ffgmgh
262262
name: init-scripts
263263
- configMap:
264264
name: complete-wfs-capabilities-generator-mfbh8cgh5c

internal/controller/test_data/wfs/minimal/expected/configmap-init-scripts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
pdok.nl/inspire: 'false'
1212
service-type: wfs
1313
service-version: v1_0
14-
name: minimal-wfs-init-scripts-fft29bbtdd
14+
name: minimal-wfs-init-scripts-f8k8ffgmgh
1515
namespace: default
1616
ownerReferences:
1717
- apiVersion: pdok.nl/v3

0 commit comments

Comments
 (0)