From a62b13eaedb0403855a417febf29c11f3f5bd6e0 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Wed, 31 Jul 2024 00:48:05 -0700 Subject: [PATCH] Use dictionary for sidecars Signed-off-by: Tamal Saha --- apis/installer/v1alpha1/trickster_types.go | 2 +- apis/installer/v1alpha1/zz_generated.deepcopy.go | 6 +++--- charts/trickster/Chart.yaml | 2 +- charts/trickster/README.md | 12 ++++++------ charts/trickster/templates/deployment.yaml | 2 +- charts/trickster/values.openapiv3_schema.yaml | 4 ++-- charts/trickster/values.yaml | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apis/installer/v1alpha1/trickster_types.go b/apis/installer/v1alpha1/trickster_types.go index 57961594..f247d1da 100644 --- a/apis/installer/v1alpha1/trickster_types.go +++ b/apis/installer/v1alpha1/trickster_types.go @@ -80,7 +80,7 @@ type TricksterSpec struct { type TricksterSidecars struct { // +optional - Spec []core.Container `json:"spec"` + Spec map[string]core.Container `json:"spec"` // +optional Volumes []core.Volume `json:"volumes"` } diff --git a/apis/installer/v1alpha1/zz_generated.deepcopy.go b/apis/installer/v1alpha1/zz_generated.deepcopy.go index db104dd1..4bb4674c 100644 --- a/apis/installer/v1alpha1/zz_generated.deepcopy.go +++ b/apis/installer/v1alpha1/zz_generated.deepcopy.go @@ -1001,9 +1001,9 @@ func (in *TricksterSidecars) DeepCopyInto(out *TricksterSidecars) { *out = *in if in.Spec != nil { in, out := &in.Spec, &out.Spec - *out = make([]v1.Container, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + *out = make(map[string]v1.Container, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() } } if in.Volumes != nil { diff --git a/charts/trickster/Chart.yaml b/charts/trickster/Chart.yaml index 02e3b9e9..552663f0 100644 --- a/charts/trickster/Chart.yaml +++ b/charts/trickster/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: trickster description: A Helm chart for Trickster by AppsCode type: application -version: v2023.10.1 +version: v2024.7.31 appVersion: v2.0.0-beta3 home: https://github.com/open-viz/trickster icon: https://cdn.appscode.com/images/products/kubeops/icons/android-icon-192x192.png diff --git a/charts/trickster/README.md b/charts/trickster/README.md index b72cde6a..d614d9be 100644 --- a/charts/trickster/README.md +++ b/charts/trickster/README.md @@ -7,8 +7,8 @@ ```bash $ helm repo add appscode https://charts.appscode.com/stable/ $ helm repo update -$ helm search repo appscode/trickster --version=v2023.10.1 -$ helm upgrade -i trickster appscode/trickster -n kubeops --create-namespace --version=v2023.10.1 +$ helm search repo appscode/trickster --version=v2024.7.31 +$ helm upgrade -i trickster appscode/trickster -n kubeops --create-namespace --version=v2024.7.31 ``` ## Introduction @@ -24,7 +24,7 @@ This chart deploys a Trickster Server on a [Kubernetes](http://kubernetes.io) cl To install/upgrade the chart with the release name `trickster`: ```bash -$ helm upgrade -i trickster appscode/trickster -n kubeops --create-namespace --version=v2023.10.1 +$ helm upgrade -i trickster appscode/trickster -n kubeops --create-namespace --version=v2024.7.31 ``` The command deploys a Trickster Server on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. @@ -80,19 +80,19 @@ The following table lists the configurable parameters of the `trickster` chart a | monitoring.agent | Name of monitoring agent (eg "prometheus.io/operator") | "" | | monitoring.port | | 8080 | | monitoring.serviceMonitor.labels | Specify the labels for ServiceMonitor. Prometheus crd will select ServiceMonitor using these labels. Only usable when monitoring agent is `prometheus.io/operator`. | {} | -| sidecars.spec | | [] | +| sidecars.spec | | {} | | sidecars.volumes | | [] | Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example: ```bash -$ helm upgrade -i trickster appscode/trickster -n kubeops --create-namespace --version=v2023.10.1 --set replicaCount=1 +$ helm upgrade -i trickster appscode/trickster -n kubeops --create-namespace --version=v2024.7.31 --set replicaCount=1 ``` Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example: ```bash -$ helm upgrade -i trickster appscode/trickster -n kubeops --create-namespace --version=v2023.10.1 --values values.yaml +$ helm upgrade -i trickster appscode/trickster -n kubeops --create-namespace --version=v2024.7.31 --values values.yaml ``` diff --git a/charts/trickster/templates/deployment.yaml b/charts/trickster/templates/deployment.yaml index d1ba7933..d2f0bff4 100644 --- a/charts/trickster/templates/deployment.yaml +++ b/charts/trickster/templates/deployment.yaml @@ -44,7 +44,7 @@ spec: - mountPath: /conf.d name: trickster-config containers: - {{- with .Values.sidecars.spec }} + {{- with (values .Values.sidecars.spec) }} {{- toYaml . | nindent 8 }} {{- end }} - name: {{ .Chart.Name }} diff --git a/charts/trickster/values.openapiv3_schema.yaml b/charts/trickster/values.openapiv3_schema.yaml index 8d6fe85e..50c1a7b8 100644 --- a/charts/trickster/values.openapiv3_schema.yaml +++ b/charts/trickster/values.openapiv3_schema.yaml @@ -1378,7 +1378,7 @@ properties: sidecars: properties: spec: - items: + additionalProperties: description: A single application container that you want to run within a pod. properties: @@ -2600,7 +2600,7 @@ properties: required: - name type: object - type: array + type: object volumes: items: description: Volume represents a named volume in a pod that may be accessed diff --git a/charts/trickster/values.yaml b/charts/trickster/values.yaml index 6b0c7706..4b45f18b 100644 --- a/charts/trickster/values.yaml +++ b/charts/trickster/values.yaml @@ -103,5 +103,5 @@ monitoring: labels: {} sidecars: - spec: [] + spec: {} volumes: []