Skip to content

Commit

Permalink
[tiles-api] Added tilesets types
Browse files Browse the repository at this point in the history
  • Loading branch information
Bolodya1997 committed Oct 3, 2023
1 parent 47a776f commit e8f34b2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
5 changes: 2 additions & 3 deletions charts/tiles-api/configs/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
12 changes: 12 additions & 0 deletions charts/tiles-api/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 1 addition & 3 deletions charts/tiles-api/templates/import.configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit e8f34b2

Please sign in to comment.