fix(odoo) fix odoo db host (#13225)

**Description**
Fix host value and remove the excess quotes.

```
psycopg2.OperationalError: could not translate host name ""odoo-cnpg-main-rw"" to address: Name or service not known
```
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [X] 🪛 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?**
<!--
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:**
@stavros-k does this chart need a initContainer to init the db at all?

```shell
/usr/bin/odoo --config=/etc/odoo/odoo.conf --stop-after-init --without-demo=all --init=base
```

**✔️ 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>
This commit is contained in:
Xstar97TheNoob
2023-10-07 18:48:10 +03:00
committed by GitHub
co-authored by Stavros Kois
parent a528939334
commit 4c0965e8b0
4 changed files with 54 additions and 24 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ appVersion: "16.0.0"
dependencies: dependencies:
- name: common - name: common
repository: https://library-charts.truecharts.org repository: https://library-charts.truecharts.org
version: 14.0.1 version: 14.0.3
deprecated: false deprecated: false
description: All-in-one business software. Beautiful. Easy-to-use. CRM, Accounting, PM, HR, Procurement, Point of Sale, MRP, Marketing, etc. description: All-in-one business software. Beautiful. Easy-to-use. CRM, Accounting, PM, HR, Procurement, Point of Sale, MRP, Marketing, etc.
home: https://truecharts.org/charts/incubator/odoo home: https://truecharts.org/charts/incubator/odoo
@@ -26,8 +26,8 @@ sources:
- https://github.com/truecharts/charts/tree/master/charts/incubator/odoo - https://github.com/truecharts/charts/tree/master/charts/incubator/odoo
- https://github.com/odoo/docker - https://github.com/odoo/docker
type: application type: application
version: 14.0.2 version: 14.0.3
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- media - productivity
truecharts.org/SCALE-support: "true" truecharts.org/SCALE-support: "true"
+2 -2
View File
@@ -106,13 +106,13 @@ questions:
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: 101
- 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: 101
# Include{securityContextContainer} # Include{securityContextContainer}
# Include{securityContextAdvanced} # Include{securityContextAdvanced}
# Include{securityContextPod} # Include{securityContextPod}
@@ -6,13 +6,13 @@
{{- $smtp := .Values.odoo.smtp -}} {{- $smtp := .Values.odoo.smtp -}}
{{- $mainPort := .Values.service.main.ports.main.port -}} {{- $mainPort := .Values.service.main.ports.main.port -}}
{{- $odooPath := .Values.persistence.odoo.mountPath -}} {{- $odooPath := .Values.persistence.odoo.targetSelector.main.main.mountPath -}}
{{- $addonsPath := .Values.persistence.addons.mountPath -}} {{- $addonsPath := .Values.persistence.addons.targetSelector.main.main.mountPath -}}
{{- $pgdb := .Values.cnpg.main.database -}} {{- $pgdb := .Values.cnpg.main.database -}}
{{- $pguser := .Values.cnpg.main.user -}} {{- $pguser := .Values.cnpg.main.user -}}
{{- $pgpassword := .Values.cnpg.main.creds.password | trimAll "\"" -}} {{- $pgpassword := .Values.cnpg.main.creds.password | trimAll "\"" -}}
{{- $pghost := .Values.cnpg.main.creds.host -}} {{- $pghost := .Values.cnpg.main.creds.host | trimAll "\"" -}}
{{/* xmlrpc* keys are deprecated and http* keys are used in their place */}} {{/* xmlrpc* keys are deprecated and http* keys are used in their place */}}
{{- $reservedKeys := (list "data_dir" "addons_path" "http_enable" "http_interface" {{- $reservedKeys := (list "data_dir" "addons_path" "http_enable" "http_interface"
+46 -16
View File
@@ -3,6 +3,12 @@ image:
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: v16.0.0@sha256:9a0e0d913dc6c4ed5904ae233dc2de7fa1a00f10eb5a66f21e1f695c62933a1d tag: v16.0.0@sha256:9a0e0d913dc6c4ed5904ae233dc2de7fa1a00f10eb5a66f21e1f695c62933a1d
securityContext:
container:
readOnlyRootFilesystem: false
runAsUser: 101
runAsGroup: 101
service: service:
main: main:
ports: ports:
@@ -15,6 +21,22 @@ odoo:
workload: workload:
main: main:
podSpec: podSpec:
initContainers:
init-db:
type: install
enabled: true
imageSelector: "image"
env:
ODOO_RC: /etc/odoo/odoo.conf
command:
- /bin/bash
args:
- -c
- |
/usr/bin/odoo --config=/etc/odoo/odoo.conf \
--stop-after-init \
--without-demo=all \
--init=base
containers: containers:
main: main:
probes: probes:
@@ -31,38 +53,46 @@ workload:
type: http type: http
path: /web/health path: /web/health
env: env:
USER: "{{ .Values.cnpg.main.user }}" ODOO_RC: /etc/odoo/odoo.conf
PORT: 5432
PASSWORD:
secretKeyRef:
name: cnpg-main-user
key: password
HOST:
secretKeyRef:
name: cnpg-main-urls
key: host
persistence: persistence:
odoo: odoo:
enabled: true enabled: true
mountPath: "/var/lib/odoo" targetSelector:
main:
main:
mountPath: "/var/lib/odoo"
init-db:
mountPath: "/var/lib/odoo"
addons: addons:
enabled: true enabled: true
mountPath: "/mnt/extra-addons" targetSelector:
main:
main:
mountPath: "/mnt/extra-addons"
init-db:
mountPath: "/mnt/extra-addons"
odoo-config: odoo-config:
enabled: true enabled: true
type: configmap type: configmap
objectName: odoo-config objectName: odoo-config
mountPath: /etc/odoo/odoo.conf targetSelector:
subPath: odoo.conf main:
readOnly: true main:
mountPath: /etc/odoo/odoo.conf
subPath: odoo.conf
readOnly: true
init-db:
mountPath: /etc/odoo/odoo.conf
subPath: odoo.conf
readOnly: true
# Enabled postgres # Enabled postgres
cnpg: cnpg:
main: main:
enabled: true enabled: true
user: odoo user: odoo
database: postgres database: odoo
portal: portal:
open: open: