Skip to content

Commit

Permalink
feat: init the stac queryables patch
Browse files Browse the repository at this point in the history
  • Loading branch information
nleconte-csgroup authored Oct 22, 2024
1 parent ef804db commit e888f1a
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
47 changes: 47 additions & 0 deletions charts/rs-server-catalog-db/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2024 CS Group
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-add-queryables
namespace: {{ .Values.namespace }}

data:
{{ .Values.app.pgstac_post_actions_script }}: |-
{{ if .Values.app.stac }}
{{ if .Values.app.stac.extensions }}
{{ range .Values.app.stac.extensions }}
psql -X -q -v ON_ERROR_STOP=1 <<EOSQL
INSERT INTO stac_extensions (url)
VALUES
({{ . | squote }})
ON CONFLICT DO NOTHING;
EOSQL
{{ end }}
{{ end }}
{{ if .Values.app.stac.queryables }}
{{ range .Values.app.stac.queryables }}
psql -X -q -v ON_ERROR_STOP=1 <<EOSQL
INSERT INTO queryables (name)
VALUES
({{ . | squote }})
ON CONFLICT DO NOTHING;
EOSQL
{{ end }}
{{ end }}
{{ end }}
4 changes: 4 additions & 0 deletions charts/rs-server-catalog-db/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ spec:
type: {{ .Values.namespace }}
spec:
terminationGracePeriodSeconds: 30
initContainers:
- name: init-{{ .Release.Name }}
image: alpine/curl
command:
containers:
- name: {{ .Release.Name }}
image: "{{ template "mychart.image" .Values.image }}"
Expand Down
29 changes: 29 additions & 0 deletions charts/rs-server-catalog-db/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,35 @@
# -- Namespace for the deployment
namespace: database

app:
pgstac_post_actions_script: pgstac_post_actions.sh
stac:
extensions:
- https://stac-extensions.github.io/eo/v1.1.0/schema.json
- https://stac-extensions.github.io/sat/v1.0.0/schema.json
- https://stac-extensions.github.io/projection/v1.1.0/schema.json
- https://stac-extensions.github.io/processing/v1.2.0/schema.json
- https://stac-extensions.github.io/product/v0.1.0/schema.json
- https://stac-extensions.github.io/sar/v1.0.0/schema.json
- https://stac-extensions.github.io/raster/v1.1.0/schema.json
- https://stac-extensions.github.io/authentication/v1.1.0/schema.json
- https://stac-extensions.github.io/alternate-assets/v1.2.0/schema.json
- https://stac-extensions.github.io/timestamps/v1.1.0/schema.json
queryables:
- eo:snow_cover
- sat:absolute_orbit
- sat:relative_orbit
- processing:level
- processing:facility
- processing:datetime
- processing:version
- product:type
- product:timeliness
- product:timeliness_category
- sar:instrument_mode
- published
- expires
- unpublished
service:
# -- Port for the service
port: 5432
Expand Down

0 comments on commit e888f1a

Please sign in to comment.