From 9179fd5608efe4db4b78703be5700b91d25acab8 Mon Sep 17 00:00:00 2001 From: Philip Schmid Date: Sun, 15 Mar 2026 02:22:12 +0100 Subject: [PATCH] fix(helm): merge customAnnotations with class-specific ingress annotations (#2161) Signed-off-by: Philip Schmid Co-authored-by: houseme --- CHANGELOG.md | 3 +++ helm/README.md | 2 +- helm/rustfs/templates/ingress.yaml | 9 +++++---- helm/rustfs/values.yaml | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a151441e..143cc29b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- **Helm Ingress**: `customAnnotations` are now merged with class-specific annotations (nginx/traefik) instead of being ignored when `ingress.className` is set. + ### Added - **OpenStack Keystone Authentication Integration**: Full support for OpenStack Keystone authentication via X-Auth-Token headers - Tower-based middleware (`KeystoneAuthLayer`) self-contained within `rustfs-keystone` crate diff --git a/helm/README.md b/helm/README.md index 7305b7ed..ad973d59 100644 --- a/helm/README.md +++ b/helm/README.md @@ -71,7 +71,7 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | ingress.nginxAnnotations."nginx.ingress.kubernetes.io/session-cookie-hash" | string | `"sha1"` | | | ingress.nginxAnnotations."nginx.ingress.kubernetes.io/session-cookie-max-age" | string | `"3600"` | | | ingress.nginxAnnotations."nginx.ingress.kubernetes.io/session-cookie-name" | string | `"rustfs"` | | -| ingress.customAnnotations | dict | `{}` |Customize annotations. | +| ingress.customAnnotations | dict | `{}` | Additional custom annotations, merged with class-specific stickiness annotations. | | ingress.traefikAnnotations."traefik.ingress.kubernetes.io/service.sticky.cookie" | string | `"true"` | | | ingress.traefikAnnotations."traefik.ingress.kubernetes.io/service.sticky.cookie.httponly" | string | `"true"` | | | ingress.traefikAnnotations."traefik.ingress.kubernetes.io/service.sticky.cookie.name" | string | `"rustfs"` | | diff --git a/helm/rustfs/templates/ingress.yaml b/helm/rustfs/templates/ingress.yaml index 3c802140..c2b841d7 100644 --- a/helm/rustfs/templates/ingress.yaml +++ b/helm/rustfs/templates/ingress.yaml @@ -1,11 +1,12 @@ {{- if .Values.ingress.enabled -}} {{- $ingressAnnotations := dict }} {{- if eq .Values.ingress.className "nginx" }} -{{- $ingressAnnotations = .Values.ingress.nginxAnnotations }} +{{- $ingressAnnotations = deepCopy (default (dict) .Values.ingress.nginxAnnotations) }} {{- else if eq .Values.ingress.className "traefik" }} -{{- $ingressAnnotations = .Values.ingress.traefikAnnotations }} -{{- else if eq .Values.ingress.className "" }} -{{- $ingressAnnotations = .Values.ingress.customAnnotations }} +{{- $ingressAnnotations = deepCopy (default (dict) .Values.ingress.traefikAnnotations) }} +{{- end }} +{{- with .Values.ingress.customAnnotations }} +{{- $ingressAnnotations = merge $ingressAnnotations . }} {{- end }} apiVersion: networking.k8s.io/v1 kind: Ingress diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index 9acd3533..71e1d6b9 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -158,8 +158,8 @@ ingress: nginx.ingress.kubernetes.io/session-cookie-hash: sha1 nginx.ingress.kubernetes.io/session-cookie-max-age: "3600" nginx.ingress.kubernetes.io/session-cookie-name: rustfs - customAnnotations: # Specify custom annotations - {} # Customize annotations + customAnnotations: # Additional custom annotations (merged with class-specific annotations) + {} hosts: - host: example.rustfs.com paths: