Skip to content

Commit 73e406e

Browse files
authored
Merge pull request #98 from PDOK/jd/download-list-fix-2
Always set GEOPACKAGE_DOWNLOAD_LIST
2 parents f04f8d1 + ffc604b commit 73e406e

File tree

14 files changed

+30
-36
lines changed

14 files changed

+30
-36
lines changed

internal/controller/blobdownload/blob_download.go

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,20 @@ func GetBlobDownloadInitContainer[O pdoknlv3.WMSWFS](obj O, images types.Images,
4242
}
4343
}
4444

45-
envVars := []corev1.EnvVar{
46-
{
47-
Name: "GEOPACKAGE_TARGET_PATH",
48-
Value: "/srv/data/gpkg",
49-
},
50-
}
51-
if len(blobkeys) > 0 {
52-
envVars = append(envVars, corev1.EnvVar{
53-
Name: "GEOPACKAGE_DOWNLOAD_LIST",
54-
Value: strings.Join(blobkeys, ";"),
55-
})
56-
}
57-
5845
initContainer := corev1.Container{
5946
Name: constants.BlobDownloadName,
6047
Image: images.MultitoolImage,
6148
ImagePullPolicy: corev1.PullIfNotPresent,
62-
Env: envVars,
49+
Env: []corev1.EnvVar{
50+
{
51+
Name: "GEOPACKAGE_TARGET_PATH",
52+
Value: "/srv/data/gpkg",
53+
},
54+
{
55+
Name: "GEOPACKAGE_DOWNLOAD_LIST",
56+
Value: strings.Join(blobkeys, ";"),
57+
},
58+
},
6359
EnvFrom: []corev1.EnvFromSource{
6460
utils.NewEnvFromSource(utils.EnvFromSourceTypeConfigMap, blobsConfigName),
6561
utils.NewEnvFromSource(utils.EnvFromSourceTypeSecret, blobsSecretName),

internal/controller/blobdownload/gpkg_download.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,14 @@ function download_all() {
117117

118118
# Download all geopackages from GEOPACKAGE_DOWNLOAD_LIST
119119
# Example: GEOPACKAGE_DOWNLOAD_LIST=path/1/file.gpkg;path/3/other_file.gpkg
120-
if [ -n "$GEOPACKAGE_DOWNLOAD_LIST" ]; then
121-
gpkgs=(${GEOPACKAGE_DOWNLOAD_LIST//;/ })
122-
for gpkg_path in "${gpkgs[@]}"
123-
do
124-
filename=$(basename $gpkg_path)
125-
download $gpkg_path $filename
126-
done
127-
128-
echo msg=\"All GeoPackages downloaded\" total_time_seconds=$(expr $(date '+%s') - $start_time)
129-
fi
120+
gpkgs=(${GEOPACKAGE_DOWNLOAD_LIST//;/ })
121+
for gpkg_path in "${gpkgs[@]}"
122+
do
123+
filename=$(basename $gpkg_path)
124+
download $gpkg_path $filename
125+
done
126+
127+
echo msg=\"All GeoPackages downloaded\" total_time_seconds=$(expr $(date '+%s') - $start_time)
130128
}
131129

132130
function rm_file_and_exit() {

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-dcmbkf564h
182+
name: complete-wfs-init-scripts-fft29bbtdd
183183
namespace: default
184184
ownerReferences:
185185
- apiVersion: pdok.nl/v3

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ spec:
258258
name: mapserver
259259
- configMap:
260260
defaultMode: 511
261-
name: complete-wfs-init-scripts-dcmbkf564h
261+
name: complete-wfs-init-scripts-fft29bbtdd
262262
name: init-scripts
263263
- configMap:
264264
name: complete-wfs-capabilities-generator-g7fh2dbt4m

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-dcmbkf564h
14+
name: minimal-wfs-init-scripts-fft29bbtdd
1515
namespace: default
1616
ownerReferences:
1717
- apiVersion: pdok.nl/v3

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ spec:
241241
name: mapserver
242242
- configMap:
243243
defaultMode: 511
244-
name: minimal-wfs-init-scripts-dcmbkf564h
244+
name: minimal-wfs-init-scripts-fft29bbtdd
245245
name: init-scripts
246246
- configMap:
247247
name: minimal-wfs-capabilities-generator-m46924mtk7

internal/controller/test_data/wms/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: wms
180180
service-version: v1_0
181181
theme: "2016"
182-
name: complete-wms-init-scripts-dcmbkf564h
182+
name: complete-wms-init-scripts-fft29bbtdd
183183
namespace: default
184184
ownerReferences:
185185
- apiVersion: pdok.nl/v3

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ spec:
375375
name: ogc-webservice-proxy-config
376376
- configMap:
377377
defaultMode: 511
378-
name: complete-wms-init-scripts-dcmbkf564h
378+
name: complete-wms-init-scripts-fft29bbtdd
379379
name: init-scripts
380380
- configMap:
381381
name: complete-wms-capabilities-generator-ccc59c7dhm

internal/controller/test_data/wms/custom-mapfile/expected/configmap-init-scripts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ metadata:
178178
pdok.nl/inspire: "false"
179179
service-type: wms
180180
service-version: v1_0
181-
name: custom-mapfile-wms-init-scripts-dcmbkf564h
181+
name: custom-mapfile-wms-init-scripts-fft29bbtdd
182182
namespace: default
183183
ownerReferences:
184184
- apiVersion: pdok.nl/v3

internal/controller/test_data/wms/custom-mapfile/expected/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ spec:
325325
name: ogc-webservice-proxy-config
326326
- configMap:
327327
defaultMode: 511
328-
name: custom-mapfile-wms-init-scripts-dcmbkf564h
328+
name: custom-mapfile-wms-init-scripts-fft29bbtdd
329329
name: init-scripts
330330
- configMap:
331331
name: custom-mapfile-wms-capabilities-generator-fbhc96kd2b

0 commit comments

Comments
 (0)