From 663765f109a6c70468da67da0c467645a4098f13 Mon Sep 17 00:00:00 2001 From: Jerry Sun Date: Fri, 15 May 2020 15:03:51 -0400 Subject: [PATCH] Automatically roll deployments when config is changed Automatically roll deployments when config is changed. Otherwise, the new config is pushed but the behavior is not. We cannot do the exact thing upstream did because of an armada bug. We are doing what monitor-armada-app does when it runs into the same issue. Closes-Bug: 1864504 Change-Id: Ib714694c93b57a28d37da595ba2efd6885bf9307 Signed-off-by: Jerry Sun --- dex-helm/centos/build_srpm.data | 2 +- dex-helm/centos/dex-helm.spec | 2 ++ .../0004-Automatically-roll-deployments.patch | 33 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 dex-helm/files/0004-Automatically-roll-deployments.patch diff --git a/dex-helm/centos/build_srpm.data b/dex-helm/centos/build_srpm.data index c7e44dc..0ed006f 100644 --- a/dex-helm/centos/build_srpm.data +++ b/dex-helm/centos/build_srpm.data @@ -4,4 +4,4 @@ VERSION=1.0.0 TAR="$TAR_NAME-$SHA.tar.gz" COPY_LIST="${CGCS_BASE}/downloads/$TAR $PKG_BASE/files/* " -TIS_PATCH_VER=0 +TIS_PATCH_VER=1 diff --git a/dex-helm/centos/dex-helm.spec b/dex-helm/centos/dex-helm.spec index 8633e9c..ea4e90b 100644 --- a/dex-helm/centos/dex-helm.spec +++ b/dex-helm/centos/dex-helm.spec @@ -27,6 +27,7 @@ Source3: Makefile Patch01: 0001-Update-Dex-chart-for-Kubernetes-API-1.16.patch Patch02: 0002-add-image-pull-secrets.patch Patch03: 0003-Add-affinity-support.patch +Patch04: 0004-Automatically-roll-deployments.patch BuildArch: noarch @@ -41,6 +42,7 @@ StarlingX OIDC auth Helm charts %patch01 -p1 %patch02 -p1 %patch03 -p1 +%patch04 -p1 %build # initialize helm diff --git a/dex-helm/files/0004-Automatically-roll-deployments.patch b/dex-helm/files/0004-Automatically-roll-deployments.patch new file mode 100644 index 0000000..df8e9a3 --- /dev/null +++ b/dex-helm/files/0004-Automatically-roll-deployments.patch @@ -0,0 +1,33 @@ +From 7b1b709abdb995ee5a6f3c56000c01a7eec96fff Mon Sep 17 00:00:00 2001 +From: Jerry Sun +Date: Wed, 13 May 2020 11:00:20 -0400 +Subject: [PATCH 1/1] Automatically roll deployments + +Automatically roll deployments when config is changed. +Otherwise, the new config is pushed but the behavior +is not. We cannot do the exact thing upstream did +because of an armada bug. We are doing what monitor +does when it runs into the same issue. +Reference upstream commit: +https://github.com/helm/charts/commit/af19146e72a1eae813e7bc6ce21b0aea9cea4341 + +Signed-off-by: Jerry Sun +--- + stable/dex/templates/deployment.yaml | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/stable/dex/templates/deployment.yaml b/stable/dex/templates/deployment.yaml +index 5e714e9..1df25b4 100644 +--- a/stable/dex/templates/deployment.yaml ++++ b/stable/dex/templates/deployment.yaml +@@ -31,6 +31,8 @@ spec: + labels: + app: {{ template "dex.name" . }} + release: "{{ .Release.Name }}" ++ annotations: ++ configchecksum: {{ toYaml .Values.config | sha256sum | trunc 63 }} + spec: + serviceAccountName: {{ template "dex.serviceAccountName" . }} + nodeSelector: +-- +2.7.4