From e8f34b242719019436c7d5af8348d57c7e58dfb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D0=BE=D0=B2=20=D0=92=D0=BB=D0=B0=D0=B4?= =?UTF-8?q?=D0=B8=D0=BC=D0=B8=D1=80=20=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B5?= =?UTF-8?q?=D0=B2=D0=B8=D1=87?= Date: Tue, 3 Oct 2023 16:44:58 +0700 Subject: [PATCH] [tiles-api] Added tilesets types --- charts/tiles-api/configs/api.yaml | 5 ++--- charts/tiles-api/templates/_helpers.tpl | 12 ++++++++++++ charts/tiles-api/templates/import.configmap.yaml | 4 +--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/charts/tiles-api/configs/api.yaml b/charts/tiles-api/configs/api.yaml index b00698dd3..aecf67a3f 100644 --- a/charts/tiles-api/configs/api.yaml +++ b/charts/tiles-api/configs/api.yaml @@ -22,9 +22,8 @@ cassandra-clusters: {{- range $_, $type := $.Values.types }} - tileset: {{ $type.name | default (include "tiles.kind" $type) }} keyspace: {{ include "tiles.keyspace" (merge $type $) }} - {{- if $type.subtype }} - type: ald - {{- else if $default }} + type: {{ include "tiles.type" $type }} + {{- if and $default (not $type.subtype) }} default: {{ $default }} {{- $default = false }} {{- end }} diff --git a/charts/tiles-api/templates/_helpers.tpl b/charts/tiles-api/templates/_helpers.tpl index a797ec066..df05be14c 100644 --- a/charts/tiles-api/templates/_helpers.tpl +++ b/charts/tiles-api/templates/_helpers.tpl @@ -57,6 +57,18 @@ dgis_tileserver_{{ include "tiles.kind" . }}_{{ required "Valid .Values.cassandr {{- end -}} {{- end -}} +{{- define "tiles.type" -}} +{{- if .subtype -}} +ald +{{- else if has .kind (list "web" "native") -}} +vector +{{- else if eq .kind "raster" -}} +raster +{{- else if eq .kind "mapbox" -}} +mapbox +{{- end -}} +{{- end -}} + {{- define "tiles.checksum" -}} {{ (include (print $.Template.BasePath .path) $ | fromYaml).data | toYaml | sha256sum }} {{- end }} diff --git a/charts/tiles-api/templates/import.configmap.yaml b/charts/tiles-api/templates/import.configmap.yaml index 8a6b3c7f9..3be549254 100644 --- a/charts/tiles-api/templates/import.configmap.yaml +++ b/charts/tiles-api/templates/import.configmap.yaml @@ -22,9 +22,7 @@ data: keyspaces: - tileset: {{ $type.name | default (include "tiles.kind" $type) }} keyspace: {{ include "tiles.keyspace" (merge $type $) }} - {{- if $type.subtype }} - type: ald - {{- end }} + type: {{ include "tiles.type" $type }} default: true partition-size: 4 {{- with $.Values.cassandra }}