From f9518d4c6dbedafd4f85679e0b0a6129aaee4f2b Mon Sep 17 00:00:00 2001 From: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Date: Mon, 3 Jul 2023 16:48:38 -0400 Subject: [PATCH] migrate(openbooks) migrate openbooks to new common (#9941) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** migrate to new common ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [X] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [X] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [X] ⚖️ My code follows the style guidelines of this project - [X] 👀 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 - [X] ⬆️ 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: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Stavros kois --- charts/incubator/openbooks/Chart.yaml | 4 +- charts/incubator/openbooks/questions.yaml | 69 ++++++++++--------- .../incubator/openbooks/templates/NOTES.txt | 1 + .../incubator/openbooks/templates/_args.tpl | 15 ++-- .../incubator/openbooks/templates/common.yaml | 8 +-- charts/incubator/openbooks/values.yaml | 33 ++++++--- 6 files changed, 73 insertions(+), 57 deletions(-) create mode 100644 charts/incubator/openbooks/templates/NOTES.txt diff --git a/charts/incubator/openbooks/Chart.yaml b/charts/incubator/openbooks/Chart.yaml index e22e56b0e14..6dbb28b8eb9 100644 --- a/charts/incubator/openbooks/Chart.yaml +++ b/charts/incubator/openbooks/Chart.yaml @@ -3,7 +3,7 @@ appVersion: "4.5.0" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 11.1.2 + version: 12.14.2 deprecated: false description: IRC Highway eBook Downloads. home: https://truecharts.org/charts/incubator/openbooks @@ -21,7 +21,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/openbooks - https://github.com/evan-buss/openbooks type: application -version: 0.0.3 +version: 1.0.0 annotations: truecharts.org/catagories: | - media diff --git a/charts/incubator/openbooks/questions.yaml b/charts/incubator/openbooks/questions.yaml index 5e23695a539..d09f26c94e9 100644 --- a/charts/incubator/openbooks/questions.yaml +++ b/charts/incubator/openbooks/questions.yaml @@ -6,13 +6,13 @@ questions: # Include{global} # Include{workload} # Include{workloadDeployment} - # Include{replicas1} # Include{podSpec} # Include{containerMain} # Include{containerBasic} # Include{containerAdvanced} - +# Include{containerConfig} +# Include{podOptions} - variable: openbooks group: App Configuration label: OpenBooks Configuration @@ -75,26 +75,19 @@ questions: schema: type: boolean default: true -# Include{containerConfig} # Include{serviceRoot} - - variable: main - label: Main Service - description: The Primary service on which the healthcheck runs, often the webUI - schema: - additional_attrs: true - type: dict - attrs: +# Include{serviceMain} # Include{serviceSelectorLoadBalancer} # Include{serviceSelectorExtras} - variable: main - label: Main Service Port Configuration + label: "Main Service Port Configuration" schema: additional_attrs: true type: dict attrs: - variable: port - label: Port - description: This port exposes the container port on the service + label: "Port" + description: "This port exposes the container port on the service" schema: type: int default: 10608 @@ -104,8 +97,16 @@ questions: # Include{serviceList} # Include{persistenceRoot} - variable: books - label: App Books Storage - description: Stores the Application Books. + label: "App Books Storage" + description: "Stores the Application Books." + schema: + additional_attrs: true + type: dict + attrs: +# Include{persistenceBasic} + - variable: logs + label: "App Logs Storage" + description: "Stores the Application Logs." schema: additional_attrs: true type: dict @@ -114,7 +115,7 @@ questions: # Include{persistenceList} # Include{ingressRoot} - variable: main - label: Main Ingress + label: "Main Ingress" schema: additional_attrs: true type: dict @@ -126,27 +127,27 @@ questions: # Include{ingressList} # Include{securityContextRoot} - - variable: runAsUser - label: runAsUser - description: The UserID of the user running the application - schema: - type: int - default: 568 - - variable: runAsGroup - label: runAsGroup - description: The groupID this App of the user running the application - schema: - type: int - default: 568 + - variable: runAsUser + label: "runAsUser" + description: "The UserID of the user running the application" + schema: + type: int + default: 568 + - variable: runAsGroup + label: "runAsGroup" + description: "The groupID this App of the user running the application" + schema: + type: int + default: 568 # Include{securityContextContainer} # Include{securityContextAdvanced} # Include{securityContextPod} - - variable: fsGroup - label: fsGroup - description: The group that should own ALL storage. - schema: - type: int - default: 568 + - variable: fsGroup + label: "fsGroup" + description: "The group that should own ALL storage." + schema: + type: int + default: 568 # Include{resources} # Include{advanced} diff --git a/charts/incubator/openbooks/templates/NOTES.txt b/charts/incubator/openbooks/templates/NOTES.txt new file mode 100644 index 00000000000..efcb74cb772 --- /dev/null +++ b/charts/incubator/openbooks/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "tc.v1.common.lib.chart.notes" $ -}} diff --git a/charts/incubator/openbooks/templates/_args.tpl b/charts/incubator/openbooks/templates/_args.tpl index 84e71357e1c..2afc78406cc 100644 --- a/charts/incubator/openbooks/templates/_args.tpl +++ b/charts/incubator/openbooks/templates/_args.tpl @@ -1,24 +1,25 @@ {{- define "openbooks.args" -}} +{{- $openbooks := .Values.openbooks -}} args: - --port - {{ .Values.service.main.ports.main.port | quote }} - --name - - {{ .Values.openbooks.user_name }} + - {{ $openbooks.user_name }} - --searchbot - - {{ .Values.openbooks.search }} - {{- if .Values.openbooks.tls }} + - {{ $openbooks.search }} + {{- if $openbooks.tls }} - --tls {{- end -}} - {{- if .Values.openbooks.log }} + {{- if $openbooks.log }} - --log {{- end -}} - {{- if .Values.openbooks.debug }} + {{- if $openbooks.debug }} - --debug {{- end -}} - {{- if .Values.openbooks.persist }} + {{- if $openbooks.persist }} - --persist {{- end -}} - {{- if .Values.openbooks.no_browser_downloads }} + {{- if $openbooks.no_browser_downloads }} - --no-browser-downloads {{- end -}} {{- end -}} diff --git a/charts/incubator/openbooks/templates/common.yaml b/charts/incubator/openbooks/templates/common.yaml index 85af2bc45fe..1619272b7b4 100644 --- a/charts/incubator/openbooks/templates/common.yaml +++ b/charts/incubator/openbooks/templates/common.yaml @@ -1,8 +1,8 @@ {{/* Make sure all variables are set properly */}} -{{- include "tc.common.loader.init" . }} +{{- include "tc.v1.common.loader.init" . }} -{{- $args := concat .Values.args (include "openbooks.args" . | fromYaml).args }} -{{- $_ := set .Values "args" $args -}} +{{- $newArgs := (include "openbooks.args" . | fromYaml) }} +{{- $_ := set .Values.workload.main.podSpec.containers.main "args" $newArgs.args -}} {{/* Render the templates */}} -{{ include "tc.common.loader.apply" . }} +{{ include "tc.v1.common.loader.apply" . }} diff --git a/charts/incubator/openbooks/values.yaml b/charts/incubator/openbooks/values.yaml index ebdddfd9378..4662b312302 100644 --- a/charts/incubator/openbooks/values.yaml +++ b/charts/incubator/openbooks/values.yaml @@ -4,7 +4,8 @@ image: tag: 4.5.0@sha256:fe1b693d63397e01a5673b8b16180539c1cb952abfe4ebfb58d0950ab9886adc securityContext: - readOnlyRootFilesystem: false + container: + readOnlyRootFilesystem: false openbooks: user_name: truecharts @@ -16,25 +17,37 @@ openbooks: no_browser_downloads: false tls: true -probes: - liveness: - type: HTTP - readiness: - type: HTTP - startup: - type: HTTP +workload: + main: + podSpec: + containers: + main: + probes: + liveness: + path: "/" + type: http + readiness: + path: "/" + type: http + startup: + path: "/" + type: http service: main: ports: main: - protocol: HTTP + protocol: http port: 10608 persistence: books: enabled: true mountPath: /books/books + logs: + enabled: true + mountPath: /books/logs portal: - enabled: true + open: + enabled: true