From ba6594e93f6562354b64ab427347712679dc4458 Mon Sep 17 00:00:00 2001
From: Fabian Schindler <fabian.schindler.strauss@gmail.com>
Date: Fri, 12 Aug 2022 15:42:03 +0200
Subject: [PATCH] Fixing registrar config template Adding additional template
 values for default registrar route

---
 charts/vs-registrar/files/registrar-config.yaml | 14 +++++++++++---
 charts/vs-registrar/values.yaml                 |  5 +++++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/charts/vs-registrar/files/registrar-config.yaml b/charts/vs-registrar/files/registrar-config.yaml
index 486e340..a06c03b 100644
--- a/charts/vs-registrar/files/registrar-config.yaml
+++ b/charts/vs-registrar/files/registrar-config.yaml
@@ -36,8 +36,10 @@ routes:
   {{- if not ( .Values.config.disableDefaultRoute ) }}
   items:
     path: registrar.route.stac.ItemRoute
-    replace: true
-    queue: register
+    queue: {{ .Values.config.defaultQueue | default "register" }}
+    {{ if .Values.config.defaultSuccessQueue -}} success_queue: {{ .Values.config.defaultSuccessQueue }} {{- end }}
+    {{ if .Values.config.defaultErrorQueue -}} error_queue: {{ .Values.config.defaultErrorQueue }} {{- end }}
+    {{ if .Values.config.defaultReplace -}} replace: {{ .Values.config.defaultReplace }} {{- end }}
     backends:
       - path: registrar.backend.eoxserver.ItemBackend
         kwargs:
@@ -51,5 +53,11 @@ routes:
           {{- $prod_type_val := unset $prod_type_val "defaultBrowse" }}
           -{{- toYaml $prod_type_val | nindent 14 -}}
           {{- end -}}
+    {{- if .Values.config.defaultHandlers }}
+    handlers:
+      {{- toYaml .Values.config.defaultHandlers | nindent 8 }}
+    {{- end }}
+  {{- end }}
+  {{- if .Values.config.routes }}
+  {{- toYaml .Values.config.routes | nindent 4 -}}
   {{- end }}
-  {{- toYaml .Values.config.routes | nindent 2 -}}
diff --git a/charts/vs-registrar/values.yaml b/charts/vs-registrar/values.yaml
index 72f4f51..bd31071 100644
--- a/charts/vs-registrar/values.yaml
+++ b/charts/vs-registrar/values.yaml
@@ -26,6 +26,11 @@ config:
   disableDefaultRoute: false
   eoxserverInstanceBasePath: "/var/www/pvs/dev"
   eoxserverInstanceName: "pvs_instance"
+  defaultQueue: "register"
+  defaultSuccessQueue:
+  defaultErrorQueue:
+  defaultReplace: true
+  defaultHandlers:
   routes: {}
 
 global:
-- 
GitLab