From ce4572265b5add1bc4f38d895bd0e5fbcae7933e Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Wed, 30 Aug 2023 14:20:09 +0300 Subject: [PATCH] NAS-123809 / 24.04 / Gitea fix strategy (#1493) * fix gitea update stratetgy * add db details to notes.txt --- library/ix-dev/community/gitea/Chart.yaml | 2 +- .../gitea/templates/_configuration.tpl | 5 +++++ .../ix-dev/community/gitea/upgrade_strategy | 2 +- library/ix-dev/community/gitea/values.yaml | 18 ++++++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/library/ix-dev/community/gitea/Chart.yaml b/library/ix-dev/community/gitea/Chart.yaml index 67ee0750ce..6d9ad568d6 100644 --- a/library/ix-dev/community/gitea/Chart.yaml +++ b/library/ix-dev/community/gitea/Chart.yaml @@ -3,7 +3,7 @@ description: Gitea - Git with a cup of tea annotations: title: Gitea type: application -version: 1.0.15 +version: 1.0.16 apiVersion: v2 appVersion: '1.19.0' kubeVersion: '>=1.16.0-0' diff --git a/library/ix-dev/community/gitea/templates/_configuration.tpl b/library/ix-dev/community/gitea/templates/_configuration.tpl index eb52c13499..1a3265cf4a 100644 --- a/library/ix-dev/community/gitea/templates/_configuration.tpl +++ b/library/ix-dev/community/gitea/templates/_configuration.tpl @@ -15,6 +15,11 @@ {{- $dbPass = ((index .data "POSTGRES_PASSWORD") | b64dec) -}} {{- end -}} + {{/* Temporary set dynamic db details on values, + so we can print them on the notes */}} + {{- $_ := set .Values "giteaDbPass" $dbPass -}} + {{- $_ := set .Values "giteaDbHost" $dbHost -}} + {{ $dbURL := (printf "postgres://%s:%s@%s:5432/%s?sslmode=disable" $dbUser $dbPass $dbHost $dbName) }} secret: postgres-creds: diff --git a/library/ix-dev/community/gitea/upgrade_strategy b/library/ix-dev/community/gitea/upgrade_strategy index a7382c62c7..c232cd92d9 100755 --- a/library/ix-dev/community/gitea/upgrade_strategy +++ b/library/ix-dev/community/gitea/upgrade_strategy @@ -11,7 +11,7 @@ RE_STABLE_VERSION = re.compile(r'[0-9]+\.[0-9]+\.[0-9]+-rootless') def newer_mapping(image_tags): key = list(image_tags.keys())[0] - tags = {t: t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)} + tags = {t.strip('-rootless'): t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)} version = semantic_versioning(list(tags)) if not version: return {} diff --git a/library/ix-dev/community/gitea/values.yaml b/library/ix-dev/community/gitea/values.yaml index b7678526a9..8d3af15717 100644 --- a/library/ix-dev/community/gitea/values.yaml +++ b/library/ix-dev/community/gitea/values.yaml @@ -38,3 +38,21 @@ giteaStorage: pgBackup: type: ixVolume datasetName: pgBackup + +notes: + custom: | + ## Database + You can connect to the database using the pgAdmin App from the catalog + +
+ Database Details + + - Database: `gitea` + - Username: `gitea` + - Password: `{{ .Values.giteaDbPass }}` + - Host: `{{ .Values.giteaDbHost }}.{{ .Release.Namespace }}.svc.cluster.local` + - Port: `5432` + +
+ {{- $_ := unset .Values "giteaDbPass" }} + {{- $_ := unset .Values "giteaDbHost" }}