Skip to content

Commit

Permalink
redpanda: fix the type of imagePullSecrets (#1385)
Browse files Browse the repository at this point in the history
The original charts used []LocalObjectReference,
not plain []string.
  • Loading branch information
jan-g authored Jun 26, 2024
1 parent ec1b16f commit d5e20fd
Show file tree
Hide file tree
Showing 76 changed files with 2,911 additions and 1,473 deletions.
2 changes: 1 addition & 1 deletion charts/redpanda/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type: application
# The chart version and the app version are not the same and will not track
# together. The chart version is a semver representation of changes to this
# chart.
version: 5.8.10
version: 5.8.11

# The app version is the default version of Redpanda to install.
# ** NOTE for maintainers: please ensure the artifacthub image annotation is updated before merging
Expand Down
2 changes: 1 addition & 1 deletion charts/redpanda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
description: Find the default values and descriptions of settings in the Redpanda Helm chart.
---

![Version: 5.8.10](https://img.shields.io/badge/Version-5.8.10-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v24.1.8](https://img.shields.io/badge/AppVersion-v24.1.8-informational?style=flat-square)
![Version: 5.8.11](https://img.shields.io/badge/Version-5.8.11-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v24.1.8](https://img.shields.io/badge/AppVersion-v24.1.8-informational?style=flat-square)

This page describes the official Redpanda Helm Chart. In particular, this page describes the contents of the chart’s [`values.yaml` file](https://github.com/redpanda-data/helm-charts/blob/main/charts/redpanda/values.yaml). Each of the settings is listed and described on this page, along with any default values.

Expand Down
19 changes: 19 additions & 0 deletions charts/redpanda/ci/39-default-image-pull-secrets-novalues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
---
# Confirm the correct passthrough of imagePullSecrets
imagePullSecrets:
- name: secret-1
- name: secret-2
12 changes: 1 addition & 11 deletions charts/redpanda/post_install_upgrade_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func PostInstallUpgradeJob(dot *helmette.Dot) *batchv1.Job {
Tolerations: tolerations(dot),
RestartPolicy: corev1.RestartPolicyNever,
SecurityContext: PodSecurityContext(dot),
ImagePullSecrets: pullSecrets(dot),
ImagePullSecrets: helmette.Default(nil, values.ImagePullSecrets),
Containers: []corev1.Container{
{
Name: fmt.Sprintf("%s-post-install", Name(dot)),
Expand Down Expand Up @@ -184,13 +184,3 @@ func tolerations(dot *helmette.Dot) []corev1.Toleration {
}
return result
}

func pullSecrets(dot *helmette.Dot) []corev1.LocalObjectReference {
values := helmette.Unwrap[Values](dot.Values)

var result []corev1.LocalObjectReference
for _, r := range values.ImagePullSecrets {
result = append(result, corev1.LocalObjectReference{Name: r})
}
return result
}
15 changes: 1 addition & 14 deletions charts/redpanda/templates/post-install-upgrade-job.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{- (dict "r" (coalesce nil)) | toJson -}}
{{- break -}}
{{- end -}}
{{- $job := (mustMergeOverwrite (dict "metadata" (dict "creationTimestamp" (coalesce nil) ) "spec" (dict "template" (dict "metadata" (dict "creationTimestamp" (coalesce nil) ) "spec" (dict "containers" (coalesce nil) ) ) ) "status" (dict ) ) (mustMergeOverwrite (dict ) (dict "apiVersion" "batch/v1" "kind" "Job" )) (dict "metadata" (mustMergeOverwrite (dict "creationTimestamp" (coalesce nil) ) (dict "name" (printf "%s-configuration" (get (fromJson (include "redpanda.Fullname" (dict "a" (list $dot) ))) "r")) "namespace" $dot.Release.Namespace "labels" (merge (dict ) (get (fromJson (include "redpanda.FullLabels" (dict "a" (list $dot) ))) "r") (default (dict ) $values.post_install_job.labels)) "annotations" (merge (dict ) (dict "helm.sh/hook" "post-install,post-upgrade" "helm.sh/hook-delete-policy" "before-hook-creation" "helm.sh/hook-weight" "-5" ) (default (dict ) $values.post_install_job.annotations)) )) "spec" (mustMergeOverwrite (dict "template" (dict "metadata" (dict "creationTimestamp" (coalesce nil) ) "spec" (dict "containers" (coalesce nil) ) ) ) (dict "template" (mustMergeOverwrite (dict "metadata" (dict "creationTimestamp" (coalesce nil) ) "spec" (dict "containers" (coalesce nil) ) ) (dict "metadata" (mustMergeOverwrite (dict "creationTimestamp" (coalesce nil) ) (dict "generateName" (printf "%s-post-" $dot.Release.Name) "labels" (merge (dict ) (dict "app.kubernetes.io/name" (get (fromJson (include "redpanda.Name" (dict "a" (list $dot) ))) "r") "app.kubernetes.io/instance" $dot.Release.Name "app.kubernetes.io/component" (printf "%.50s-post-install" (get (fromJson (include "redpanda.Name" (dict "a" (list $dot) ))) "r")) ) (default (dict ) $values.commonLabels)) )) "spec" (mustMergeOverwrite (dict "containers" (coalesce nil) ) (dict "nodeSelector" $values.nodeSelector "affinity" (get (fromJson (include "redpanda.postInstallJobAffinity" (dict "a" (list $dot) ))) "r") "tolerations" (get (fromJson (include "redpanda.tolerations" (dict "a" (list $dot) ))) "r") "restartPolicy" "Never" "securityContext" (get (fromJson (include "redpanda.PodSecurityContext" (dict "a" (list $dot) ))) "r") "imagePullSecrets" (get (fromJson (include "redpanda.pullSecrets" (dict "a" (list $dot) ))) "r") "containers" (list (mustMergeOverwrite (dict "name" "" "resources" (dict ) ) (dict "name" (printf "%s-post-install" (get (fromJson (include "redpanda.Name" (dict "a" (list $dot) ))) "r")) "image" (printf "%s:%s" $values.image.repository (get (fromJson (include "redpanda.Tag" (dict "a" (list $dot) ))) "r")) "env" (get (fromJson (include "redpanda.PostInstallUpgradeEnvironmentVariables" (dict "a" (list $dot) ))) "r") "command" (list "bash" "-c") "args" (list ) "resources" (get (fromJson (include "_shims.ptr_Deref" (dict "a" (list $values.post_install_job.resources (mustMergeOverwrite (dict ) (dict ))) ))) "r") "securityContext" (merge (dict ) (default (mustMergeOverwrite (dict ) (dict )) $values.post_install_job.securityContext) (get (fromJson (include "redpanda.ContainerSecurityContext" (dict "a" (list $dot) ))) "r")) "volumeMounts" (get (fromJson (include "redpanda.DefaultMounts" (dict "a" (list $dot) ))) "r") ))) "volumes" (get (fromJson (include "redpanda.DefaultVolumes" (dict "a" (list $dot) ))) "r") "serviceAccountName" (get (fromJson (include "redpanda.ServiceAccountName" (dict "a" (list $dot) ))) "r") )) )) )) )) -}}
{{- $job := (mustMergeOverwrite (dict "metadata" (dict "creationTimestamp" (coalesce nil) ) "spec" (dict "template" (dict "metadata" (dict "creationTimestamp" (coalesce nil) ) "spec" (dict "containers" (coalesce nil) ) ) ) "status" (dict ) ) (mustMergeOverwrite (dict ) (dict "apiVersion" "batch/v1" "kind" "Job" )) (dict "metadata" (mustMergeOverwrite (dict "creationTimestamp" (coalesce nil) ) (dict "name" (printf "%s-configuration" (get (fromJson (include "redpanda.Fullname" (dict "a" (list $dot) ))) "r")) "namespace" $dot.Release.Namespace "labels" (merge (dict ) (get (fromJson (include "redpanda.FullLabels" (dict "a" (list $dot) ))) "r") (default (dict ) $values.post_install_job.labels)) "annotations" (merge (dict ) (dict "helm.sh/hook" "post-install,post-upgrade" "helm.sh/hook-delete-policy" "before-hook-creation" "helm.sh/hook-weight" "-5" ) (default (dict ) $values.post_install_job.annotations)) )) "spec" (mustMergeOverwrite (dict "template" (dict "metadata" (dict "creationTimestamp" (coalesce nil) ) "spec" (dict "containers" (coalesce nil) ) ) ) (dict "template" (mustMergeOverwrite (dict "metadata" (dict "creationTimestamp" (coalesce nil) ) "spec" (dict "containers" (coalesce nil) ) ) (dict "metadata" (mustMergeOverwrite (dict "creationTimestamp" (coalesce nil) ) (dict "generateName" (printf "%s-post-" $dot.Release.Name) "labels" (merge (dict ) (dict "app.kubernetes.io/name" (get (fromJson (include "redpanda.Name" (dict "a" (list $dot) ))) "r") "app.kubernetes.io/instance" $dot.Release.Name "app.kubernetes.io/component" (printf "%.50s-post-install" (get (fromJson (include "redpanda.Name" (dict "a" (list $dot) ))) "r")) ) (default (dict ) $values.commonLabels)) )) "spec" (mustMergeOverwrite (dict "containers" (coalesce nil) ) (dict "nodeSelector" $values.nodeSelector "affinity" (get (fromJson (include "redpanda.postInstallJobAffinity" (dict "a" (list $dot) ))) "r") "tolerations" (get (fromJson (include "redpanda.tolerations" (dict "a" (list $dot) ))) "r") "restartPolicy" "Never" "securityContext" (get (fromJson (include "redpanda.PodSecurityContext" (dict "a" (list $dot) ))) "r") "imagePullSecrets" (default (coalesce nil) $values.imagePullSecrets) "containers" (list (mustMergeOverwrite (dict "name" "" "resources" (dict ) ) (dict "name" (printf "%s-post-install" (get (fromJson (include "redpanda.Name" (dict "a" (list $dot) ))) "r")) "image" (printf "%s:%s" $values.image.repository (get (fromJson (include "redpanda.Tag" (dict "a" (list $dot) ))) "r")) "env" (get (fromJson (include "redpanda.PostInstallUpgradeEnvironmentVariables" (dict "a" (list $dot) ))) "r") "command" (list "bash" "-c") "args" (list ) "resources" (get (fromJson (include "_shims.ptr_Deref" (dict "a" (list $values.post_install_job.resources (mustMergeOverwrite (dict ) (dict ))) ))) "r") "securityContext" (merge (dict ) (default (mustMergeOverwrite (dict ) (dict )) $values.post_install_job.securityContext) (get (fromJson (include "redpanda.ContainerSecurityContext" (dict "a" (list $dot) ))) "r")) "volumeMounts" (get (fromJson (include "redpanda.DefaultMounts" (dict "a" (list $dot) ))) "r") ))) "volumes" (get (fromJson (include "redpanda.DefaultVolumes" (dict "a" (list $dot) ))) "r") "serviceAccountName" (get (fromJson (include "redpanda.ServiceAccountName" (dict "a" (list $dot) ))) "r") )) )) )) )) -}}
{{- $script := (coalesce nil) -}}
{{- $script = (concat (default (list ) $script) (list `set -e`)) -}}
{{- if (get (fromJson (include "redpanda.RedpandaAtLeast_22_2_0" (dict "a" (list $dot) ))) "r") -}}
Expand Down Expand Up @@ -52,16 +52,3 @@
{{- end -}}
{{- end -}}

{{- define "redpanda.pullSecrets" -}}
{{- $dot := (index .a 0) -}}
{{- range $_ := (list 1) -}}
{{- $values := $dot.Values.AsMap -}}
{{- $result := (coalesce nil) -}}
{{- range $_, $r := $values.imagePullSecrets -}}
{{- $result = (concat (default (list ) $result) (list (mustMergeOverwrite (dict ) (dict "name" $r )))) -}}
{{- end -}}
{{- (dict "r" $result) | toJson -}}
{{- break -}}
{{- end -}}
{{- end -}}

42 changes: 21 additions & 21 deletions charts/redpanda/testdata/ci/01-default-values.yaml.golden
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
name: redpanda
namespace: default
spec:
Expand Down Expand Up @@ -49,7 +49,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
name: redpanda-sts-lifecycle
namespace: default
stringData:
Expand Down Expand Up @@ -142,7 +142,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
name: redpanda-config-watcher
namespace: default
stringData:
Expand Down Expand Up @@ -180,7 +180,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
name: redpanda-configurator
namespace: default
stringData:
Expand Down Expand Up @@ -428,7 +428,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
name: redpanda
namespace: default
---
Expand Down Expand Up @@ -459,7 +459,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
name: redpanda-rpk
namespace: default
---
Expand Down Expand Up @@ -532,7 +532,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
monitoring.redpanda.com/enabled: "false"
name: redpanda
namespace: default
Expand Down Expand Up @@ -579,7 +579,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
name: redpanda-external
namespace: default
spec:
Expand Down Expand Up @@ -743,7 +743,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
spec:
selector:
matchLabels:
Expand All @@ -762,10 +762,10 @@ spec:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
redpanda.com/poddisruptionbudget: redpanda
annotations:
config.redpanda.com/checksum: 0e448033777a1fc6bcc970eff47a691cae9bb16e0aff074cfb00fd06c7da6d11
config.redpanda.com/checksum: c44cce63405ee771589aabf243f7b6f3cb7629709ecdb7219963809efb85b907
spec:
terminationGracePeriodSeconds: 90
securityContext:
Expand Down Expand Up @@ -1056,7 +1056,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
spec:
duration: 43800h
isCA: true
Expand All @@ -1082,7 +1082,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
spec:
duration: 43800h
isCA: true
Expand All @@ -1106,7 +1106,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
name: redpanda-default-cert
namespace: default
spec:
Expand Down Expand Up @@ -1145,7 +1145,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
name: redpanda-external-cert
namespace: default
spec:
Expand Down Expand Up @@ -1186,7 +1186,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
spec:
selfSigned: {}
---
Expand All @@ -1202,7 +1202,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
spec:
ca:
secretName: redpanda-default-root-certificate
Expand All @@ -1219,7 +1219,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
spec:
selfSigned: {}
---
Expand All @@ -1235,7 +1235,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
spec:
ca:
secretName: redpanda-external-root-certificate
Expand Down Expand Up @@ -1277,7 +1277,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
name: redpanda-configuration
namespace: default
spec:
Expand Down Expand Up @@ -1365,7 +1365,7 @@ metadata:
app.kubernetes.io/instance: redpanda
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redpanda
helm.sh/chart: redpanda-5.8.10
helm.sh/chart: redpanda-5.8.11
annotations:
"helm.sh/hook": post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation
Expand Down
Loading

0 comments on commit d5e20fd

Please sign in to comment.