diff --git a/internal/controller/blobdownload/blob_download.go b/internal/controller/blobdownload/blob_download.go index e9c903a..d6bce1c 100644 --- a/internal/controller/blobdownload/blob_download.go +++ b/internal/controller/blobdownload/blob_download.go @@ -42,24 +42,20 @@ func GetBlobDownloadInitContainer[O pdoknlv3.WMSWFS](obj O, images types.Images, } } - envVars := []corev1.EnvVar{ - { - Name: "GEOPACKAGE_TARGET_PATH", - Value: "/srv/data/gpkg", - }, - } - if len(blobkeys) > 0 { - envVars = append(envVars, corev1.EnvVar{ - Name: "GEOPACKAGE_DOWNLOAD_LIST", - Value: strings.Join(blobkeys, ";"), - }) - } - initContainer := corev1.Container{ Name: constants.BlobDownloadName, Image: images.MultitoolImage, ImagePullPolicy: corev1.PullIfNotPresent, - Env: envVars, + Env: []corev1.EnvVar{ + { + Name: "GEOPACKAGE_TARGET_PATH", + Value: "/srv/data/gpkg", + }, + { + Name: "GEOPACKAGE_DOWNLOAD_LIST", + Value: strings.Join(blobkeys, ";"), + }, + }, EnvFrom: []corev1.EnvFromSource{ utils.NewEnvFromSource(utils.EnvFromSourceTypeConfigMap, blobsConfigName), utils.NewEnvFromSource(utils.EnvFromSourceTypeSecret, blobsSecretName), diff --git a/internal/controller/blobdownload/gpkg_download.sh b/internal/controller/blobdownload/gpkg_download.sh index a7bdef4..8d036a0 100644 --- a/internal/controller/blobdownload/gpkg_download.sh +++ b/internal/controller/blobdownload/gpkg_download.sh @@ -117,16 +117,14 @@ function download_all() { # Download all geopackages from GEOPACKAGE_DOWNLOAD_LIST # Example: GEOPACKAGE_DOWNLOAD_LIST=path/1/file.gpkg;path/3/other_file.gpkg - if [ -n "$GEOPACKAGE_DOWNLOAD_LIST" ]; then - gpkgs=(${GEOPACKAGE_DOWNLOAD_LIST//;/ }) - for gpkg_path in "${gpkgs[@]}" - do - filename=$(basename $gpkg_path) - download $gpkg_path $filename - done - - echo msg=\"All GeoPackages downloaded\" total_time_seconds=$(expr $(date '+%s') - $start_time) - fi + gpkgs=(${GEOPACKAGE_DOWNLOAD_LIST//;/ }) + for gpkg_path in "${gpkgs[@]}" + do + filename=$(basename $gpkg_path) + download $gpkg_path $filename + done + + echo msg=\"All GeoPackages downloaded\" total_time_seconds=$(expr $(date '+%s') - $start_time) } function rm_file_and_exit() { diff --git a/internal/controller/test_data/wfs/complete/expected/configmap-init-scripts.yaml b/internal/controller/test_data/wfs/complete/expected/configmap-init-scripts.yaml index 83e8b6c..ad70452 100644 --- a/internal/controller/test_data/wfs/complete/expected/configmap-init-scripts.yaml +++ b/internal/controller/test_data/wfs/complete/expected/configmap-init-scripts.yaml @@ -179,7 +179,7 @@ metadata: service-type: wfs service-version: v1_0 theme: theme - name: complete-wfs-init-scripts-dcmbkf564h + name: complete-wfs-init-scripts-fft29bbtdd namespace: default ownerReferences: - apiVersion: pdok.nl/v3 diff --git a/internal/controller/test_data/wfs/complete/expected/deployment.yaml b/internal/controller/test_data/wfs/complete/expected/deployment.yaml index 9275d98..cbae2df 100644 --- a/internal/controller/test_data/wfs/complete/expected/deployment.yaml +++ b/internal/controller/test_data/wfs/complete/expected/deployment.yaml @@ -258,7 +258,7 @@ spec: name: mapserver - configMap: defaultMode: 511 - name: complete-wfs-init-scripts-dcmbkf564h + name: complete-wfs-init-scripts-fft29bbtdd name: init-scripts - configMap: name: complete-wfs-capabilities-generator-g7fh2dbt4m diff --git a/internal/controller/test_data/wfs/minimal/expected/configmap-init-scripts.yaml b/internal/controller/test_data/wfs/minimal/expected/configmap-init-scripts.yaml index 243426f..3563e0f 100644 --- a/internal/controller/test_data/wfs/minimal/expected/configmap-init-scripts.yaml +++ b/internal/controller/test_data/wfs/minimal/expected/configmap-init-scripts.yaml @@ -11,7 +11,7 @@ metadata: pdok.nl/inspire: 'false' service-type: wfs service-version: v1_0 - name: minimal-wfs-init-scripts-dcmbkf564h + name: minimal-wfs-init-scripts-fft29bbtdd namespace: default ownerReferences: - apiVersion: pdok.nl/v3 diff --git a/internal/controller/test_data/wfs/minimal/expected/deployment.yaml b/internal/controller/test_data/wfs/minimal/expected/deployment.yaml index 5852310..ce7277d 100644 --- a/internal/controller/test_data/wfs/minimal/expected/deployment.yaml +++ b/internal/controller/test_data/wfs/minimal/expected/deployment.yaml @@ -241,7 +241,7 @@ spec: name: mapserver - configMap: defaultMode: 511 - name: minimal-wfs-init-scripts-dcmbkf564h + name: minimal-wfs-init-scripts-fft29bbtdd name: init-scripts - configMap: name: minimal-wfs-capabilities-generator-m46924mtk7 diff --git a/internal/controller/test_data/wms/complete/expected/configmap-init-scripts.yaml b/internal/controller/test_data/wms/complete/expected/configmap-init-scripts.yaml index e0f5971..51abcc2 100644 --- a/internal/controller/test_data/wms/complete/expected/configmap-init-scripts.yaml +++ b/internal/controller/test_data/wms/complete/expected/configmap-init-scripts.yaml @@ -179,7 +179,7 @@ metadata: service-type: wms service-version: v1_0 theme: "2016" - name: complete-wms-init-scripts-dcmbkf564h + name: complete-wms-init-scripts-fft29bbtdd namespace: default ownerReferences: - apiVersion: pdok.nl/v3 diff --git a/internal/controller/test_data/wms/complete/expected/deployment.yaml b/internal/controller/test_data/wms/complete/expected/deployment.yaml index ce0d8ad..cb0d145 100644 --- a/internal/controller/test_data/wms/complete/expected/deployment.yaml +++ b/internal/controller/test_data/wms/complete/expected/deployment.yaml @@ -375,7 +375,7 @@ spec: name: ogc-webservice-proxy-config - configMap: defaultMode: 511 - name: complete-wms-init-scripts-dcmbkf564h + name: complete-wms-init-scripts-fft29bbtdd name: init-scripts - configMap: name: complete-wms-capabilities-generator-ccc59c7dhm diff --git a/internal/controller/test_data/wms/custom-mapfile/expected/configmap-init-scripts.yaml b/internal/controller/test_data/wms/custom-mapfile/expected/configmap-init-scripts.yaml index ff54d76..bb9ca94 100644 --- a/internal/controller/test_data/wms/custom-mapfile/expected/configmap-init-scripts.yaml +++ b/internal/controller/test_data/wms/custom-mapfile/expected/configmap-init-scripts.yaml @@ -178,7 +178,7 @@ metadata: pdok.nl/inspire: "false" service-type: wms service-version: v1_0 - name: custom-mapfile-wms-init-scripts-dcmbkf564h + name: custom-mapfile-wms-init-scripts-fft29bbtdd namespace: default ownerReferences: - apiVersion: pdok.nl/v3 diff --git a/internal/controller/test_data/wms/custom-mapfile/expected/deployment.yaml b/internal/controller/test_data/wms/custom-mapfile/expected/deployment.yaml index 6e1eb97..5550662 100644 --- a/internal/controller/test_data/wms/custom-mapfile/expected/deployment.yaml +++ b/internal/controller/test_data/wms/custom-mapfile/expected/deployment.yaml @@ -325,7 +325,7 @@ spec: name: ogc-webservice-proxy-config - configMap: defaultMode: 511 - name: custom-mapfile-wms-init-scripts-dcmbkf564h + name: custom-mapfile-wms-init-scripts-fft29bbtdd name: init-scripts - configMap: name: custom-mapfile-wms-capabilities-generator-fbhc96kd2b diff --git a/internal/controller/test_data/wms/minimal/expected/configmap-init-scripts.yaml b/internal/controller/test_data/wms/minimal/expected/configmap-init-scripts.yaml index a43cb17..377c8d4 100644 --- a/internal/controller/test_data/wms/minimal/expected/configmap-init-scripts.yaml +++ b/internal/controller/test_data/wms/minimal/expected/configmap-init-scripts.yaml @@ -178,7 +178,7 @@ metadata: pdok.nl/inspire: "false" service-type: wms service-version: v1_0 - name: minimal-wms-init-scripts-dcmbkf564h + name: minimal-wms-init-scripts-fft29bbtdd namespace: default ownerReferences: - apiVersion: pdok.nl/v3 diff --git a/internal/controller/test_data/wms/minimal/expected/deployment.yaml b/internal/controller/test_data/wms/minimal/expected/deployment.yaml index 572c071..418ae6e 100644 --- a/internal/controller/test_data/wms/minimal/expected/deployment.yaml +++ b/internal/controller/test_data/wms/minimal/expected/deployment.yaml @@ -339,7 +339,7 @@ spec: name: ogc-webservice-proxy-config - configMap: defaultMode: 511 - name: minimal-wms-init-scripts-dcmbkf564h + name: minimal-wms-init-scripts-fft29bbtdd name: init-scripts - configMap: name: minimal-wms-capabilities-generator-fbhc96kd2b diff --git a/internal/controller/test_data/wms/patches/expected/configmap-init-scripts.yaml b/internal/controller/test_data/wms/patches/expected/configmap-init-scripts.yaml index 5b71547..8465891 100644 --- a/internal/controller/test_data/wms/patches/expected/configmap-init-scripts.yaml +++ b/internal/controller/test_data/wms/patches/expected/configmap-init-scripts.yaml @@ -178,7 +178,7 @@ metadata: pdok.nl/inspire: "false" service-type: wms service-version: v1_0 - name: patches-wms-init-scripts-dcmbkf564h + name: patches-wms-init-scripts-fft29bbtdd namespace: default ownerReferences: - apiVersion: pdok.nl/v3 diff --git a/internal/controller/test_data/wms/patches/expected/deployment.yaml b/internal/controller/test_data/wms/patches/expected/deployment.yaml index 688b7f6..a99ada6 100644 --- a/internal/controller/test_data/wms/patches/expected/deployment.yaml +++ b/internal/controller/test_data/wms/patches/expected/deployment.yaml @@ -346,7 +346,7 @@ spec: name: ogc-webservice-proxy-config - configMap: defaultMode: 511 - name: patches-wms-init-scripts-dcmbkf564h + name: patches-wms-init-scripts-fft29bbtdd name: init-scripts - configMap: name: patches-wms-capabilities-generator-hbgd5m652m