From c3da3a6f7992eeca00487ceec260f51fc6b55a40 Mon Sep 17 00:00:00 2001 From: Phil Sphicas Date: Wed, 16 Mar 2022 15:58:28 -0700 Subject: [PATCH] Fix elasticsearch cronjob rendering The pod security context for the elasticsearch cron jobs is in the wrong location, causing an error when installing or upgrading the chart. ValidationError(CronJob.spec.jobTemplate.spec): unknown field "securityContext" in io.k8s.api.batch.v1.JobSpec This change fixes the rendering. Change-Id: I0e04b1ba27113d4b7aeefa2035b2b29c45be455a --- elasticsearch/Chart.yaml | 2 +- elasticsearch/templates/cron-job-curator.yaml | 2 +- elasticsearch/templates/cron-job-verify-repositories.yaml | 2 +- releasenotes/notes/elasticsearch.yaml | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/elasticsearch/Chart.yaml b/elasticsearch/Chart.yaml index 68797c1fc..9c22cf75d 100644 --- a/elasticsearch/Chart.yaml +++ b/elasticsearch/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v7.6.2 description: OpenStack-Helm ElasticSearch name: elasticsearch -version: 0.2.13 +version: 0.2.14 home: https://www.elastic.co/ sources: - https://github.com/elastic/elasticsearch diff --git a/elasticsearch/templates/cron-job-curator.yaml b/elasticsearch/templates/cron-job-curator.yaml index ef7513844..408a60abd 100644 --- a/elasticsearch/templates/cron-job-curator.yaml +++ b/elasticsearch/templates/cron-job-curator.yaml @@ -38,12 +38,12 @@ spec: labels: {{ tuple $envAll "elasticsearch" "curator" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} spec: -{{ dict "envAll" $envAll "application" "curator" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} template: metadata: labels: {{ tuple $envAll "elasticsearch" "curator" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 12 }} spec: +{{ dict "envAll" $envAll "application" "curator" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 10 }} nodeSelector: {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value | quote }} serviceAccountName: {{ $serviceAccountName }} diff --git a/elasticsearch/templates/cron-job-verify-repositories.yaml b/elasticsearch/templates/cron-job-verify-repositories.yaml index ac392856c..6e87357e4 100644 --- a/elasticsearch/templates/cron-job-verify-repositories.yaml +++ b/elasticsearch/templates/cron-job-verify-repositories.yaml @@ -40,12 +40,12 @@ spec: annotations: {{ dict "envAll" $envAll "podName" "elasticsearch-verify-repositories" "containerNames" (list "elasticsearch-verify-repositories" "init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: -{{ dict "envAll" $envAll "application" "verify_repositories" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} template: metadata: labels: {{ tuple $envAll "elasticsearch" "verify-repositories" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 12 }} spec: +{{ dict "envAll" $envAll "application" "verify_repositories" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 10 }} nodeSelector: {{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value | quote }} serviceAccountName: {{ $serviceAccountName }} diff --git a/releasenotes/notes/elasticsearch.yaml b/releasenotes/notes/elasticsearch.yaml index 9cba0560c..9b6ba69d9 100644 --- a/releasenotes/notes/elasticsearch.yaml +++ b/releasenotes/notes/elasticsearch.yaml @@ -23,4 +23,5 @@ elasticsearch: - 0.2.11 Enable TLS path between Curator and Elasticsearch - 0.2.12 Helm 3 - Fix Job labels - 0.2.13 Update htk requirements + - 0.2.14 Fix cronjob rendering ...