From 711b8761a599b625b858f4bdfabfaa42d7437c17 Mon Sep 17 00:00:00 2001 From: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Date: Tue, 5 Dec 2023 10:13:03 -0500 Subject: [PATCH] migrate(hasty-paste): Another tested chart done (#15712) 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._ --------- Signed-off-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Signed-off-by: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Co-authored-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> --- charts/incubator/hasty-paste/Chart.yaml | 6 +- .../templates/{_secret.tpl => _secrets.tpl} | 25 ++----- .../hasty-paste/templates/common.yaml | 11 ++- charts/incubator/hasty-paste/values.yaml | 74 ++++++++++--------- 4 files changed, 57 insertions(+), 59 deletions(-) rename charts/incubator/hasty-paste/templates/{_secret.tpl => _secrets.tpl} (74%) diff --git a/charts/incubator/hasty-paste/Chart.yaml b/charts/incubator/hasty-paste/Chart.yaml index 4b74b8c879b..d606ce7c0a0 100644 --- a/charts/incubator/hasty-paste/Chart.yaml +++ b/charts/incubator/hasty-paste/Chart.yaml @@ -1,7 +1,7 @@ kubeVersion: ">=1.24.0" apiVersion: v2 name: hasty-paste -version: 0.0.14 +version: 1.0.0 appVersion: 1.9.0 description: A fast and minimal paste bin, written in Python using Quart. home: https://truecharts.org/charts/incubator/hasty-paste @@ -24,14 +24,14 @@ keywords: - Network-Other dependencies: - name: common - version: 11.1.2 + version: 15.3.1 repository: https://library-charts.truecharts.org condition: "" alias: "" tags: [] import-values: [] - name: redis - version: 5.0.33 + version: 6.0.66 repository: https://deps.truecharts.org condition: redis.enabled alias: "" diff --git a/charts/incubator/hasty-paste/templates/_secret.tpl b/charts/incubator/hasty-paste/templates/_secrets.tpl similarity index 74% rename from charts/incubator/hasty-paste/templates/_secret.tpl rename to charts/incubator/hasty-paste/templates/_secrets.tpl index 3f4388a79ca..5737de68fb8 100644 --- a/charts/incubator/hasty-paste/templates/_secret.tpl +++ b/charts/incubator/hasty-paste/templates/_secrets.tpl @@ -1,22 +1,13 @@ {{/* Define the secret */}} -{{- define "hastyPaste.secret" -}} - -{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) }} - ---- -apiVersion: v1 -kind: Secret -type: Opaque -metadata: - name: {{ $secretName }} - labels: - {{- include "tc.common.labels" . | nindent 4 }} -stringData: +{{- define "hastypaste.secrets" -}} +{{- $secretName := (printf "%s-hastypaste-secrets" (include "tc.v1.common.lib.chart.names.fullname" $)) }} +enabled: true +data: {{- $redis := .Values.redis -}} - {{- $redisPass := $redis.redisPassword | trimAll "\"" -}} - {{- $redisUser := $redis.redisUsername }} - {{- $redisURL := $redis.url.plain | trimAll "\"" }} - CACHE__REDIS_URI: {{ printf "redis://%v:%v@%v/0" $redisUser $redisPass $redisURL | quote }} + {{- $redisPass := $redis.creds.redisPassword | trimAll "\"" -}} + {{- $redisUser := $redis.username }} + {{- $redisURL := $redis.creds.plainhost | trimAll "\"" }} + CACHE__REDIS_URI: {{ printf "redis://%v:%v@%v:6379/0" $redisUser $redisPass $redisURL | quote }} CACHE__ENABLE: "true" PORT: {{ .Values.service.main.ports.main.port | quote }} TIME_ZONE: {{ .Values.TZ }} diff --git a/charts/incubator/hasty-paste/templates/common.yaml b/charts/incubator/hasty-paste/templates/common.yaml index dcbd8e10a96..4553ecbfb46 100644 --- a/charts/incubator/hasty-paste/templates/common.yaml +++ b/charts/incubator/hasty-paste/templates/common.yaml @@ -1,8 +1,11 @@ {{/* Make sure all variables are set properly */}} -{{- include "tc.common.loader.init" . }} +{{- include "tc.v1.common.loader.init" . }} -{{/* Render config */}} -{{- include "hastyPaste.secret" . }} +{{/* Render secrets for hastyPaste */}} +{{- $secrets := include "hastypaste.secrets" . | fromYaml -}} +{{- if $secrets -}} + {{- $_ := set .Values.secret "hastypaste-secrets" $secrets -}} +{{- end -}} {{/* Render the templates */}} -{{ include "tc.common.loader.apply" . }} +{{ include "tc.v1.common.loader.apply" . }} diff --git a/charts/incubator/hasty-paste/values.yaml b/charts/incubator/hasty-paste/values.yaml index fb0cfbab53b..c07720be382 100644 --- a/charts/incubator/hasty-paste/values.yaml +++ b/charts/incubator/hasty-paste/values.yaml @@ -1,7 +1,7 @@ image: - repository: tccr.io/truecharts/hasty-paste + repository: ghcr.io/enchant97/hasty-paste pullPolicy: IfNotPresent - tag: 1.9.0@sha256:428aec44d95d061a8d357fa122175e067703b906483c9168a9b95cdb66c107da + tag: 1.9.0@sha256:fbbb670ac9b201bf0a47feaa7b1588b5b5c4657bbf49518f9534f12e8e80ce3d hastyPaste: new_at_index: false @@ -23,41 +23,45 @@ hastyPaste: css_file: "" hide_version: false -envFrom: - - secretRef: - name: '{{ include "tc.common.names.fullname" . }}-secret' - -probes: - liveness: - enabled: true - custom: true - spec: - exec: - command: - - /bin/sh - - health-check.sh - readiness: - enabled: true - custom: true - spec: - exec: - command: - - /bin/sh - - health-check.sh - startup: - enabled: true - custom: true - spec: - exec: - command: - - /bin/sh - - health-check.sh +workload: + main: + podSpec: + containers: + main: + envFrom: + - secretRef: + name: "hastypaste-secrets" + probes: + liveness: + enabled: true + custom: true + spec: + exec: + command: + - /bin/sh + - health-check.sh + readiness: + enabled: true + custom: true + spec: + exec: + command: + - /bin/sh + - health-check.sh + startup: + enabled: true + custom: true + spec: + exec: + command: + - /bin/sh + - health-check.sh service: main: ports: main: - protocol: HTTP + protocol: http port: 10601 persistence: @@ -67,8 +71,8 @@ persistence: redis: enabled: true - existingSecret: rediscreds - redisUsername: default + username: default portal: - enabled: true + open: + enabled: true