From d7ff8552d1ccd15b3b9122ce8023bd0bd02c9f37 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 6 Feb 2024 04:41:14 -0500 Subject: [PATCH] fix: index the process map to ensure the correct config is pulled Without this change, certain generated process names - like those for a cron job - may be incorrectly handled when indexing the process map. --- plugins/scheduler-k3s/templates/chart/certificate.yaml | 2 +- plugins/scheduler-k3s/templates/chart/cron-job.yaml | 2 +- plugins/scheduler-k3s/templates/chart/deployment.yaml | 2 +- .../templates/chart/https-redirect-middleware.yaml | 2 +- plugins/scheduler-k3s/templates/chart/ingress-route.yaml | 2 +- plugins/scheduler-k3s/templates/chart/service.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/scheduler-k3s/templates/chart/certificate.yaml b/plugins/scheduler-k3s/templates/chart/certificate.yaml index 4feda021e..796cecd71 100644 --- a/plugins/scheduler-k3s/templates/chart/certificate.yaml +++ b/plugins/scheduler-k3s/templates/chart/certificate.yaml @@ -1,5 +1,5 @@ {{- $processName := "PROCESS_NAME" }} -{{- $config := .Values.processes.PROCESS_NAME }} +{{- $config := index .Values.processes "PROCESS_NAME" }} {{- if and $config.web.tls.enabled $config.web.domains }} --- apiVersion: cert-manager.io/v1 diff --git a/plugins/scheduler-k3s/templates/chart/cron-job.yaml b/plugins/scheduler-k3s/templates/chart/cron-job.yaml index 1460d9cb5..2dca28242 100644 --- a/plugins/scheduler-k3s/templates/chart/cron-job.yaml +++ b/plugins/scheduler-k3s/templates/chart/cron-job.yaml @@ -1,5 +1,5 @@ {{- $processName := "CRON_ID" }} -{{- $config := .Values.processes.CRON_ID }} +{{- $config := index .Values.processes "CRON_ID" }} --- apiVersion: batch/v1 kind: CronJob diff --git a/plugins/scheduler-k3s/templates/chart/deployment.yaml b/plugins/scheduler-k3s/templates/chart/deployment.yaml index f26b49c93..0c633290a 100644 --- a/plugins/scheduler-k3s/templates/chart/deployment.yaml +++ b/plugins/scheduler-k3s/templates/chart/deployment.yaml @@ -1,5 +1,5 @@ {{- $processName := "PROCESS_NAME" }} -{{- $config := .Values.processes.PROCESS_NAME }} +{{- $config := index .Values.processes "PROCESS_NAME" }} --- apiVersion: apps/v1 kind: Deployment diff --git a/plugins/scheduler-k3s/templates/chart/https-redirect-middleware.yaml b/plugins/scheduler-k3s/templates/chart/https-redirect-middleware.yaml index 64f25d252..e65ba3b1f 100644 --- a/plugins/scheduler-k3s/templates/chart/https-redirect-middleware.yaml +++ b/plugins/scheduler-k3s/templates/chart/https-redirect-middleware.yaml @@ -1,5 +1,5 @@ {{- $processName := "PROCESS_NAME" }} -{{- $config := .Values.processes.PROCESS_NAME }} +{{- $config := index .Values.processes "PROCESS_NAME" }} {{- if and $config.web.domains (eq $.Values.global.network.ingress_class "traefik") }} --- apiVersion: traefik.io/v1alpha1 diff --git a/plugins/scheduler-k3s/templates/chart/ingress-route.yaml b/plugins/scheduler-k3s/templates/chart/ingress-route.yaml index df631fe1a..8c1db08da 100644 --- a/plugins/scheduler-k3s/templates/chart/ingress-route.yaml +++ b/plugins/scheduler-k3s/templates/chart/ingress-route.yaml @@ -1,5 +1,5 @@ {{- $processName := "PROCESS_NAME" }} -{{- $config := .Values.processes.PROCESS_NAME }} +{{- $config := index .Values.processes "PROCESS_NAME" }} {{- if and $config.web.domains (eq $.Values.global.network.ingress_class "traefik") }} {{- range $pdx, $port_map := $config.web.port_maps }} --- diff --git a/plugins/scheduler-k3s/templates/chart/service.yaml b/plugins/scheduler-k3s/templates/chart/service.yaml index b413062c3..3d5619e8c 100644 --- a/plugins/scheduler-k3s/templates/chart/service.yaml +++ b/plugins/scheduler-k3s/templates/chart/service.yaml @@ -1,5 +1,5 @@ {{- $processName := "PROCESS_NAME" }} -{{- $config := .Values.processes.PROCESS_NAME }} +{{- $config := index .Values.processes "PROCESS_NAME" }} --- apiVersion: v1 kind: Service