integ/kubernetes/flux2-charts-legacy/debian/patches/0002-Add-template-option-to-allow-enabling-disabling-the-.patch
Igor Soares 9754c90b8f Upversion Flux to v2.5.1
Specific components upversioned:
* flux2-charts: v2.13.0 -> v1.15.0
* helm-controller: v1.0.1 -> v1.2.0
* source-controller: v1.3.0 -> 1.5.0
* notification-controller (optional): v1.3.0 -> 1.5.0
* kustomize-controller (optional): v1.3.0 -> 1.5.1

Image versions were also updated in the companion commit for the Ansible
playbooks repo:
https://review.opendev.org/c/starlingx/ansible-playbooks/+/947771

This moves the charts from the previous Flux version (v2.3.0) to a
legacy package named flux2-charts-legacy intended to be used for the
platform rollback scenario.

Test plan:

AIO-SX:
PASS: fresh install
PASS: platform upgrade
PASS: backup & restore
PASS: nginx-ingress-controller successfully
      uploaded/applied/removed/deleted
PASS: cert-manager successfully uploaded/applied/removed/deleted
PASS: platform-integ-apps successfully uploaded/applied/removed/deleted
PASS: oidc-auth-apps successfully uploaded/applied/removed/deleted
PASS: dell-storage successfully uploaded/applied/removed/deleted
PASS: rook-ceph successfully uploaded/applied/removed/deleted
PASS: deployment-manager successfully uploaded/applied/removed/deleted
PASS: enable notification and kustomize controllers

AIO-DX:
PASS: fresh install
PASS: platform upgrade
PASS: backup & restore

Standard:
PASS: fresh install
PASS: check if pods are allocated to controllers

Story: 2011354
Task: 52090

Change-Id: I6ab98897ab7fb97e557c3a596dea51462631da12
Signed-off-by: Igor Soares <Igor.PiresSoares@windriver.com>
2025-05-05 11:38:56 -03:00

67 lines
2.3 KiB
Diff

From 4d2eb3b9f265bcb4b80ff7d335a430560a29b234 Mon Sep 17 00:00:00 2001
From: Igor Soares <Igor.PiresSoares@windriver.com>
Date: Wed, 19 Feb 2025 10:19:02 -0300
Subject: [PATCH 2/2] Add template option to allow enabling/disabling the
pre-install job
Add the .Values.preInstallJob.create option to allow enabling/disabling
the pre-install job.
The service account related to the pre-install job will be
enabled/disabled accordingly as well.
This is required because in certain scenarios, such as platform
upgrades, we need to skip the Kubernetes version check.
Signed-off-by: Igor Soares <Igor.PiresSoares@windriver.com>
---
charts/flux2/templates/pre-install-job-serviceaccount.yaml | 2 ++
charts/flux2/templates/pre-install-job.yaml | 2 ++
charts/flux2/values.yaml | 3 +++
3 files changed, 7 insertions(+)
diff --git a/charts/flux2/templates/pre-install-job-serviceaccount.yaml b/charts/flux2/templates/pre-install-job-serviceaccount.yaml
index f634869..14b35fd 100644
--- a/charts/flux2/templates/pre-install-job-serviceaccount.yaml
+++ b/charts/flux2/templates/pre-install-job-serviceaccount.yaml
@@ -1,3 +1,4 @@
+{{- if and .Values.preInstallJob.create}}
apiVersion: v1
kind: ServiceAccount
metadata:
@@ -12,3 +13,4 @@ metadata:
"helm.sh/hook": pre-install
"helm.sh/hook-weight": "-10"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
+{{- end }}
\ No newline at end of file
diff --git a/charts/flux2/templates/pre-install-job.yaml b/charts/flux2/templates/pre-install-job.yaml
index 2c2541f..59bfa32 100644
--- a/charts/flux2/templates/pre-install-job.yaml
+++ b/charts/flux2/templates/pre-install-job.yaml
@@ -1,3 +1,4 @@
+{{- if and .Values.preInstallJob.create}}
apiVersion: batch/v1
kind: Job
metadata:
@@ -70,3 +71,4 @@ spec:
{{- with .Values.cli.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/charts/flux2/values.yaml b/charts/flux2/values.yaml
index 6a023c7..9277f13 100644
--- a/charts/flux2/values.yaml
+++ b/charts/flux2/values.yaml
@@ -325,3 +325,6 @@ prometheus:
- sourceLabels: [__meta_kubernetes_pod_phase]
action: keep
regex: Running
+
+preInstallJob:
+ create: true
--
2.34.1