Преглед изворни кода

NAS-123809 / 24.04 / Gitea fix strategy (#1493)

* fix gitea update stratetgy

* add db details to notes.txt
Stavros Kois пре 2 година
родитељ
комит
ce4572265b

+ 1 - 1
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'

+ 5 - 0
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:

+ 1 - 1
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 {}

+ 18 - 0
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
+
+    <details>
+      <summary>Database Details</summary>
+
+      - Database: `gitea`
+      - Username: `gitea`
+      - Password: `{{ .Values.giteaDbPass }}`
+      - Host:     `{{ .Values.giteaDbHost }}.{{ .Release.Namespace }}.svc.cluster.local`
+      - Port:     `5432`
+
+    </details>
+    {{- $_ := unset .Values "giteaDbPass" }}
+    {{- $_ := unset .Values "giteaDbHost" }}