From 7dbcd6174ca9c3fe9e5efafcffd264e3f3d71491 Mon Sep 17 00:00:00 2001 From: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Date: Tue, 15 Aug 2023 01:16:18 -0400 Subject: [PATCH] migrate(shiori): Migrate to New Common (#11539) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --- charts/incubator/shiori/Chart.yaml | 8 +--- charts/incubator/shiori/templates/_secret.tpl | 23 ----------- charts/incubator/shiori/templates/common.yaml | 9 +---- charts/incubator/shiori/values.yaml | 40 +++++++++++++------ 4 files changed, 30 insertions(+), 50 deletions(-) delete mode 100644 charts/incubator/shiori/templates/_secret.tpl diff --git a/charts/incubator/shiori/Chart.yaml b/charts/incubator/shiori/Chart.yaml index 4eb5cbd3c13..95208c12811 100644 --- a/charts/incubator/shiori/Chart.yaml +++ b/charts/incubator/shiori/Chart.yaml @@ -3,11 +3,7 @@ appVersion: "1.5.4" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 11.1.2 - - condition: postgresql.enabled - name: postgresql - repository: https://deps.truecharts.org/ - version: 11.0.31 + version: 14.0.1 deprecated: false description: A simple bookmark manager built with Go. home: https://truecharts.org/charts/incubator/shiori @@ -28,7 +24,7 @@ sources: - https://github.com/go-shiori/shiori - https://github.com/go-shiori/shiori/pkgs/container/shiori type: application -version: 12.0.0 +version: 13.0.0 annotations: truecharts.org/catagories: | - media diff --git a/charts/incubator/shiori/templates/_secret.tpl b/charts/incubator/shiori/templates/_secret.tpl deleted file mode 100644 index 271799e2411..00000000000 --- a/charts/incubator/shiori/templates/_secret.tpl +++ /dev/null @@ -1,23 +0,0 @@ -{{/* Define the secret */}} -{{- define "shiori.secret" -}} - -{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) }} - ---- -apiVersion: v1 -kind: Secret -metadata: - name: {{ $secretName }} - labels: - {{- include "tc.common.labels" . | nindent 4 }} -stringData: - SHIORI_DIR: {{ .Values.persistence.data.mountPath }} - - {{/* Database */}} - SHIORI_DBMS: "postgresql" - SHIORI_PG_PORT: "5432" - SHIORI_PG_USER: {{ .Values.postgresql.postgresqlUsername }} - SHIORI_PG_PASS: {{ .Values.postgresql.postgresqlPassword | trimAll "\"" }} - SHIORI_PG_NAME: {{ .Values.postgresql.postgresqlDatabase }} - SHIORI_PG_HOST: {{ .Values.postgresql.url.plain | trimAll "\"" }} -{{- end -}} diff --git a/charts/incubator/shiori/templates/common.yaml b/charts/incubator/shiori/templates/common.yaml index 160ab84e33b..b51394e00a4 100644 --- a/charts/incubator/shiori/templates/common.yaml +++ b/charts/incubator/shiori/templates/common.yaml @@ -1,8 +1 @@ -{{/* Make sure all variables are set properly */}} -{{- include "tc.common.loader.init" . }} - -{{/* Render secret */}} -{{- include "shiori.secret" . }} - -{{/* Render the templates */}} -{{ include "tc.common.loader.apply" . }} +{{ include "tc.v1.common.loader.all" . }} diff --git a/charts/incubator/shiori/values.yaml b/charts/incubator/shiori/values.yaml index 18005a9d50c..87c737c7930 100644 --- a/charts/incubator/shiori/values.yaml +++ b/charts/incubator/shiori/values.yaml @@ -1,12 +1,27 @@ image: repository: tccr.io/truecharts/shiori pullPolicy: IfNotPresent - tag: 1.5.4@sha256:d0d145787855f00b81752433cb3cfa047c833926b55a14f845cbe8dbc42b8800 - -envFrom: - - secretRef: - name: '{{ include "tc.common.names.fullname" . }}-secret' + tag: v1.5.5@sha256:2aa3fe6e09d5cb801e998a93f3f6ce13e0e7f8e75d567666a800939c6be3a474 +workload: + main: + podSpec: + containers: + main: + env: + SHIORI_DIR: "{{ .Values.persistence.data.mountPath }}" + SHIORI_DBMS: "postgresql" + SHIORI_PG_PORT: "5432" + SHIORI_PG_USER: "{{ .Values.cnpg.main.user }}" + SHIORI_PG_NAME: "{{ .Values.cnpg.main.database }}" + SHIORI_PG_HOST: + secretKeyRef: + name: cnpg-main-urls + key: host + SHIORI_PG_PASS: + secretKeyRef: + name: cnpg-main-user + key: password service: main: ports: @@ -18,14 +33,13 @@ persistence: data: enabled: true mountPath: /data - varrun: - enabled: true -postgresql: - enabled: true - existingSecret: dbcreds - postgresqlUsername: shiori - postgresqlDatabase: shiori +cnpg: + main: + enabled: true + user: shiori + password: shiori portal: - enabled: true + open: + enabled: true