From be22fc6b7372fc84c847cbce671253c990f41e46 Mon Sep 17 00:00:00 2001 From: Steve Hipwell Date: Mon, 11 Dec 2023 16:45:30 +0000 Subject: [PATCH] fix(fluentd-aggregator): Fixed legacy service mode (#844) Signed-off-by: Steve Hipwell --- charts/fluentd-aggregator/CHANGELOG.md | 7 +++++++ charts/fluentd-aggregator/Chart.yaml | 8 ++------ charts/fluentd-aggregator/README.md | 6 +++--- charts/fluentd-aggregator/templates/_helpers.tpl | 8 -------- charts/fluentd-aggregator/templates/statefulset.yaml | 2 +- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/charts/fluentd-aggregator/CHANGELOG.md b/charts/fluentd-aggregator/CHANGELOG.md index b2f0d03d..23cfe46b 100644 --- a/charts/fluentd-aggregator/CHANGELOG.md +++ b/charts/fluentd-aggregator/CHANGELOG.md @@ -20,8 +20,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] +## [v4.1.2] - 2023-12-11### Fixed + +- Fixed legacy migration by fixing the changes when the `service.legacy` value is set. + ## [v4.1.1] - 2023-12-07 +> [!WARNING] +> Do not use this version with `service.legacy` as the implementation was incorrect. + ### Changed - Updated _Fluentd Aggregator_ OCI image to [v2.10.1](https://github.com/stevehipwell/fluentd-aggregator/releases/tag/v2.10.1) (_Fluentd_ [v1.16.3](https://github.com/fluent/fluentd/releases/tag/v1.16.3)). diff --git a/charts/fluentd-aggregator/Chart.yaml b/charts/fluentd-aggregator/Chart.yaml index 052fd364..9c28ee63 100644 --- a/charts/fluentd-aggregator/Chart.yaml +++ b/charts/fluentd-aggregator/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: fluentd-aggregator description: Helm chart for Fluentd running as an aggregation StatefulSet and using the fluent-plugin-route router. type: application -version: 4.1.1 +version: 4.1.2 appVersion: 2.10.1 keywords: - fluent @@ -21,9 +21,5 @@ maintainers: annotations: artifacthub.io/alternativeName: fluentd artifacthub.io/changes: | - - kind: changed - description: "Updated _Fluentd Aggregator_ OCI image to [v2.10.1](https://github.com/stevehipwell/fluentd-aggregator/releases/tag/v2.10.1) (_Fluentd_ [v1.16.3](https://github.com/fluent/fluentd/releases/tag/v1.16.3))." - kind: fixed - description: "Fixed legacy migration by adding `service.legacy` value to support keeping the legacy headless service name." - - kind: fixed - description: "Fixed incorrect truncation of names when full name is longer than `53` characters." + description: "Fixed legacy migration by fixing the changes when the `service.legacy` value is set." diff --git a/charts/fluentd-aggregator/README.md b/charts/fluentd-aggregator/README.md index d7b18d86..eb11bb27 100644 --- a/charts/fluentd-aggregator/README.md +++ b/charts/fluentd-aggregator/README.md @@ -1,6 +1,6 @@ # fluentd-aggregator -![Version: 4.1.1](https://img.shields.io/badge/Version-4.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.10.1](https://img.shields.io/badge/AppVersion-2.10.1-informational?style=flat-square) +![Version: 4.1.2](https://img.shields.io/badge/Version-4.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.10.1](https://img.shields.io/badge/AppVersion-2.10.1-informational?style=flat-square) Helm chart for Fluentd running as an aggregation StatefulSet and using the fluent-plugin-route router. @@ -23,14 +23,14 @@ Helm chart for Fluentd running as an aggregation StatefulSet and using the fluen To install the chart using the recommended OCI method you can use the following command. ```shell -helm upgrade --install fluentd-aggregator oci://ghcr.io/stevehipwell/helm-charts/fluentd-aggregator --version 4.1.1 +helm upgrade --install fluentd-aggregator oci://ghcr.io/stevehipwell/helm-charts/fluentd-aggregator --version 4.1.2 ``` Alternativly you can use the legacy non-OCI method via the following commands. ```shell helm repo add stevehipwell https://stevehipwell.github.io/helm-charts/ -helm upgrade --install fluentd-aggregator stevehipwell/fluentd-aggregator --version 4.1.1 +helm upgrade --install fluentd-aggregator stevehipwell/fluentd-aggregator --version 4.1.2 ``` ## Values diff --git a/charts/fluentd-aggregator/templates/_helpers.tpl b/charts/fluentd-aggregator/templates/_helpers.tpl index ba254d7c..ae3cd713 100644 --- a/charts/fluentd-aggregator/templates/_helpers.tpl +++ b/charts/fluentd-aggregator/templates/_helpers.tpl @@ -68,23 +68,15 @@ Create the name of the service account to use Define the service name */}} {{- define "fluentd-aggregator.serviceName" -}} -{{- if .Values.service.legacy }} -{{- (printf "%s-default" (include "fluentd-aggregator.fullname" .) | trunc 55 | trimSuffix "-") }} -{{- else }} {{- include "fluentd-aggregator.fullname" . }} {{- end }} -{{- end }} {{/* Define the headless service name */}} {{- define "fluentd-aggregator.headlessServiceName" -}} -{{- if .Values.service.legacy }} -{{- include "fluentd-aggregator.fullname" . }} -{{- else }} {{- (printf "%s-headless" (include "fluentd-aggregator.serviceName" .) | trunc 54 | trimSuffix "-") }} {{- end }} -{{- end }} {{/* Define the config configmap name diff --git a/charts/fluentd-aggregator/templates/statefulset.yaml b/charts/fluentd-aggregator/templates/statefulset.yaml index 8d4738bb..a2837a73 100644 --- a/charts/fluentd-aggregator/templates/statefulset.yaml +++ b/charts/fluentd-aggregator/templates/statefulset.yaml @@ -6,7 +6,7 @@ metadata: labels: {{- include "fluentd-aggregator.labels" . | nindent 4 }} spec: - serviceName: {{ include "fluentd-aggregator.headlessServiceName" . }} + serviceName: {{ ternary (include "fluentd-aggregator.serviceName" .) (include "fluentd-aggregator.headlessServiceName" .) .Values.service.legacy }} {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicas }} {{- end }}