migrate(openbooks) migrate openbooks to new common (#9941)

**Description**
migrate to new common
⚒️ Fixes  # <!--(issue)-->

**⚙️ 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?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ 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 <s.kois@outlook.com>
This commit is contained in:
Xstar97TheNoob 2023-07-03 16:48:38 -04:00 committed by GitHub
parent e974a01cb3
commit f9518d4c6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 73 additions and 57 deletions

View File

@ -3,7 +3,7 @@ appVersion: "4.5.0"
dependencies: dependencies:
- name: common - name: common
repository: https://library-charts.truecharts.org repository: https://library-charts.truecharts.org
version: 11.1.2 version: 12.14.2
deprecated: false deprecated: false
description: IRC Highway eBook Downloads. description: IRC Highway eBook Downloads.
home: https://truecharts.org/charts/incubator/openbooks 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/truecharts/charts/tree/master/charts/incubator/openbooks
- https://github.com/evan-buss/openbooks - https://github.com/evan-buss/openbooks
type: application type: application
version: 0.0.3 version: 1.0.0
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- media - media

View File

@ -6,13 +6,13 @@ questions:
# Include{global} # Include{global}
# Include{workload} # Include{workload}
# Include{workloadDeployment} # Include{workloadDeployment}
# Include{replicas1} # Include{replicas1}
# Include{podSpec} # Include{podSpec}
# Include{containerMain} # Include{containerMain}
# Include{containerBasic} # Include{containerBasic}
# Include{containerAdvanced} # Include{containerAdvanced}
# Include{containerConfig}
# Include{podOptions}
- variable: openbooks - variable: openbooks
group: App Configuration group: App Configuration
label: OpenBooks Configuration label: OpenBooks Configuration
@ -75,26 +75,19 @@ questions:
schema: schema:
type: boolean type: boolean
default: true default: true
# Include{containerConfig}
# Include{serviceRoot} # Include{serviceRoot}
- variable: main # Include{serviceMain}
label: Main Service
description: The Primary service on which the healthcheck runs, often the webUI
schema:
additional_attrs: true
type: dict
attrs:
# Include{serviceSelectorLoadBalancer} # Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras} # Include{serviceSelectorExtras}
- variable: main - variable: main
label: Main Service Port Configuration label: "Main Service Port Configuration"
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: port - variable: port
label: Port label: "Port"
description: This port exposes the container port on the service description: "This port exposes the container port on the service"
schema: schema:
type: int type: int
default: 10608 default: 10608
@ -104,8 +97,16 @@ questions:
# Include{serviceList} # Include{serviceList}
# Include{persistenceRoot} # Include{persistenceRoot}
- variable: books - variable: books
label: App Books Storage label: "App Books Storage"
description: Stores the Application Books. 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: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
@ -114,7 +115,7 @@ questions:
# Include{persistenceList} # Include{persistenceList}
# Include{ingressRoot} # Include{ingressRoot}
- variable: main - variable: main
label: Main Ingress label: "Main Ingress"
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
@ -126,27 +127,27 @@ questions:
# Include{ingressList} # Include{ingressList}
# Include{securityContextRoot} # Include{securityContextRoot}
- variable: runAsUser - variable: runAsUser
label: runAsUser label: "runAsUser"
description: The UserID of the user running the application description: "The UserID of the user running the application"
schema: schema:
type: int type: int
default: 568 default: 568
- variable: runAsGroup - variable: runAsGroup
label: runAsGroup label: "runAsGroup"
description: The groupID this App of the user running the application description: "The groupID this App of the user running the application"
schema: schema:
type: int type: int
default: 568 default: 568
# Include{securityContextContainer} # Include{securityContextContainer}
# Include{securityContextAdvanced} # Include{securityContextAdvanced}
# Include{securityContextPod} # Include{securityContextPod}
- variable: fsGroup - variable: fsGroup
label: fsGroup label: "fsGroup"
description: The group that should own ALL storage. description: "The group that should own ALL storage."
schema: schema:
type: int type: int
default: 568 default: 568
# Include{resources} # Include{resources}
# Include{advanced} # Include{advanced}

View File

@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}

View File

@ -1,24 +1,25 @@
{{- define "openbooks.args" -}} {{- define "openbooks.args" -}}
{{- $openbooks := .Values.openbooks -}}
args: args:
- --port - --port
- {{ .Values.service.main.ports.main.port | quote }} - {{ .Values.service.main.ports.main.port | quote }}
- --name - --name
- {{ .Values.openbooks.user_name }} - {{ $openbooks.user_name }}
- --searchbot - --searchbot
- {{ .Values.openbooks.search }} - {{ $openbooks.search }}
{{- if .Values.openbooks.tls }} {{- if $openbooks.tls }}
- --tls - --tls
{{- end -}} {{- end -}}
{{- if .Values.openbooks.log }} {{- if $openbooks.log }}
- --log - --log
{{- end -}} {{- end -}}
{{- if .Values.openbooks.debug }} {{- if $openbooks.debug }}
- --debug - --debug
{{- end -}} {{- end -}}
{{- if .Values.openbooks.persist }} {{- if $openbooks.persist }}
- --persist - --persist
{{- end -}} {{- end -}}
{{- if .Values.openbooks.no_browser_downloads }} {{- if $openbooks.no_browser_downloads }}
- --no-browser-downloads - --no-browser-downloads
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View File

@ -1,8 +1,8 @@
{{/* Make sure all variables are set properly */}} {{/* 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 }} {{- $newArgs := (include "openbooks.args" . | fromYaml) }}
{{- $_ := set .Values "args" $args -}} {{- $_ := set .Values.workload.main.podSpec.containers.main "args" $newArgs.args -}}
{{/* Render the templates */}} {{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }} {{ include "tc.v1.common.loader.apply" . }}

View File

@ -4,7 +4,8 @@ image:
tag: 4.5.0@sha256:fe1b693d63397e01a5673b8b16180539c1cb952abfe4ebfb58d0950ab9886adc tag: 4.5.0@sha256:fe1b693d63397e01a5673b8b16180539c1cb952abfe4ebfb58d0950ab9886adc
securityContext: securityContext:
readOnlyRootFilesystem: false container:
readOnlyRootFilesystem: false
openbooks: openbooks:
user_name: truecharts user_name: truecharts
@ -16,25 +17,37 @@ openbooks:
no_browser_downloads: false no_browser_downloads: false
tls: true tls: true
probes: workload:
liveness: main:
type: HTTP podSpec:
readiness: containers:
type: HTTP main:
startup: probes:
type: HTTP liveness:
path: "/"
type: http
readiness:
path: "/"
type: http
startup:
path: "/"
type: http
service: service:
main: main:
ports: ports:
main: main:
protocol: HTTP protocol: http
port: 10608 port: 10608
persistence: persistence:
books: books:
enabled: true enabled: true
mountPath: /books/books mountPath: /books/books
logs:
enabled: true
mountPath: /books/logs
portal: portal:
enabled: true open:
enabled: true