From c90cca5fa96b3e20fa46f85fcc09280a13c66d48 Mon Sep 17 00:00:00 2001
From: Maarten de Waard <maarten@greenhost.nl>
Date: Mon, 20 Dec 2021 11:21:01 +0100
Subject: [PATCH] only create admin user on install, do not recreate on update

---
 helmchart/single-sign-on/templates/job-create-admin.yaml | 2 +-
 helmchart/single-sign-on/values.yaml                     | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/helmchart/single-sign-on/templates/job-create-admin.yaml b/helmchart/single-sign-on/templates/job-create-admin.yaml
index 8e1c3d7..6e564e4 100644
--- a/helmchart/single-sign-on/templates/job-create-admin.yaml
+++ b/helmchart/single-sign-on/templates/job-create-admin.yaml
@@ -5,7 +5,7 @@ metadata:
   labels:
 {{ include "single-sign-on.labels" . | indent 4 }}
   annotations:
-    "helm.sh/hook": post-install,post-upgrade
+    "helm.sh/hook": post-install
     "helm.sh/hook-weight": "-5"
     "helm.sh/hook-delete-policy": before-hook-creation
 spec:
diff --git a/helmchart/single-sign-on/values.yaml b/helmchart/single-sign-on/values.yaml
index 96c94ed..fe5a864 100644
--- a/helmchart/single-sign-on/values.yaml
+++ b/helmchart/single-sign-on/values.yaml
@@ -219,6 +219,7 @@ login:
     user: stackspin
     password: stackspin
     database: stackspin
+  # Admin user will be created once when the SSO system is installed.
   user: admin@example.com
   password: ThisIsNotASecurePassword
 
-- 
GitLab