diff --git a/.github/workflows/lint-and-test.yaml b/.github/workflows/lint-and-test.yaml index 02c04af0..97853c33 100644 --- a/.github/workflows/lint-and-test.yaml +++ b/.github/workflows/lint-and-test.yaml @@ -81,18 +81,16 @@ jobs: runs-on: ubuntu-latest needs: lint-and-test steps: - - name: Install readme-generator-for-helm - run: npm install -g @bitnami/readme-generator-for-helm - - name: Checkout mailu/helm-charts uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 0 - - name: Execute readme-generator-for-helm + - name: Execute pre-commit hook readme-generator-for-helm run: | + pip install pre-commit echo "Updating README.md for mailu chart" - readme-generator --values "charts/mailu/values.yaml" --readme "charts/mailu/README.md" --schema "/tmp/schema.json" + pre-commit run --show-diff-on-failure git diff --exit-code --name-status charts/mailu/README.md || { echo "README update is missing. This should have been prevented by pre-commit hook." exit 1 diff --git a/charts/mailu/README.md b/charts/mailu/README.md index c73b68ce..73e28e3d 100644 --- a/charts/mailu/README.md +++ b/charts/mailu/README.md @@ -331,14 +331,15 @@ Check that the deployed pods are all running. | `front.externalService.ports.smtps` | Expose SMTP port (TLS) - 465/tcp | `true` | | `front.externalService.ports.submission` | Expose Submission port - 587/tcp | `false` | | `front.externalService.ports.manageSieve` | Expose ManageSieve port - 4190/tcp | `true` | -| `front.externalService.nodePorts.pop3` | NodePort to use for POP3 (defaults to 110/tcp) | `110` | -| `front.externalService.nodePorts.pop3s` | NodePort to use for POP3 (TLS) (defaults to 995/tcp) | `995` | -| `front.externalService.nodePorts.imap` | NodePort to use for IMAP (defaults to 143/tcp) | `143` | -| `front.externalService.nodePorts.imaps` | NodePort to use for IMAP (TLS) (defaults to 993/tcp) | `993` | -| `front.externalService.nodePorts.smtp` | NodePort to use for SMTP (defaults to 25/tcp) | `25` | -| `front.externalService.nodePorts.smtps` | NodePort to use for SMTP (TLS) (defaults to 465/tcp) | `465` | -| `front.externalService.nodePorts.submission` | NodePort to use for Submission (defaults to 587/tcp) | `587` | -| `front.externalService.nodePorts.manageSieve` | NodePort to use for ManageSieve (defaults to 4190/tcp) | `4190` | +| `front.externalService.nodePorts` | Optionally define NodePorts. | `{}` | +| `front.externalService.nodePorts.pop3` | NodePort to use for POP3 | `undefined` | +| `front.externalService.nodePorts.pop3s` | NodePort to use for POP3 (TLS) | `undefined` | +| `front.externalService.nodePorts.imap` | NodePort to use for IMAP | `undefined` | +| `front.externalService.nodePorts.imaps` | NodePort to use for IMAP (TLS) | `undefined` | +| `front.externalService.nodePorts.smtp` | NodePort to use for SMTP | `undefined` | +| `front.externalService.nodePorts.smtps` | NodePort to use for SMTP (TLS) | `undefined` | +| `front.externalService.nodePorts.submission` | NodePort to use for Submission | `undefined` | +| `front.externalService.nodePorts.manageSieve` | NodePort to use for ManageSieve | `undefined` | | `front.kind` | Kind of resource to create for the front (`Deployment` or `DaemonSet`) | `Deployment` | | `front.replicaCount` | Number of front replicas to deploy (only for `Deployment` kind) | `1` | | `front.resources.limits` | The resources limits for the container | `{}` | @@ -1017,7 +1018,6 @@ Check that the deployed pods are all running. | `tika.extraVolumes` | Optionally specify extra list of additional volumes for the pod(s) | `[]` | | `tika.extraContainers` | Add additional containers to the pod | `[]` | - ## Example values.yaml to get started ```yaml diff --git a/charts/mailu/ci/helm-lint-values.yaml b/charts/mailu/ci/helm-lint-values.yaml index b886efcf..46db2a28 100644 --- a/charts/mailu/ci/helm-lint-values.yaml +++ b/charts/mailu/ci/helm-lint-values.yaml @@ -1,12 +1,12 @@ hostnames: - - example.com + - mailu.cluster.local -domain: example.com +domain: mailu.cluster.local initialAccount: enabled: true username: mailadmin - domain: example.com + domain: mailu.cluster.local password: chang3m3! secretKey: chang3m3! diff --git a/charts/mailu/templates/front/service-external.yaml b/charts/mailu/templates/front/service-external.yaml index 50a1afae..cbe7eede 100644 --- a/charts/mailu/templates/front/service-external.yaml +++ b/charts/mailu/templates/front/service-external.yaml @@ -27,7 +27,7 @@ spec: - name: pop3 port: 110 protocol: TCP - {{ if eq $.Values.front.externalService.type "NodePort" -}} + {{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.pop3 }} nodePort: {{ .nodePorts.pop3 }} {{- end }} {{- end }} @@ -35,7 +35,7 @@ spec: - name: pop3s port: 995 protocol: TCP - {{ if eq $.Values.front.externalService.type "NodePort" -}} + {{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.pop3s }} nodePort: {{ .nodePorts.pop3s }} {{- end }} {{- end }} @@ -43,7 +43,7 @@ spec: - name: imap port: 143 protocol: TCP - {{ if eq $.Values.front.externalService.type "NodePort" -}} + {{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.imap }} nodePort: {{ .nodePorts.imap }} {{- end }} {{- end }} @@ -51,7 +51,7 @@ spec: - name: imaps port: 993 protocol: TCP - {{ if eq $.Values.front.externalService.type "NodePort" -}} + {{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.imaps }} nodePort: {{ .nodePorts.imaps }} {{- end }} {{- end }} @@ -59,7 +59,7 @@ spec: - name: smtp port: 25 protocol: TCP - {{ if eq $.Values.front.externalService.type "NodePort" -}} + {{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.smtp }} nodePort: {{ .nodePorts.smtp }} {{- end }} {{- end }} @@ -67,7 +67,7 @@ spec: - name: smtps port: 465 protocol: TCP - {{ if eq $.Values.front.externalService.type "NodePort" -}} + {{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.smtps }} nodePort: {{ .nodePorts.smtps }} {{- end }} {{- end }} @@ -75,7 +75,7 @@ spec: - name: smtpd port: 587 protocol: TCP - {{ if eq $.Values.front.externalService.type "NodePort" -}} + {{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.submission }} nodePort: {{ .nodePorts.submission }} {{- end }} {{- end }} @@ -83,7 +83,7 @@ spec: - name: sieve port: 4190 protocol: TCP - {{ if eq $.Values.front.externalService.type "NodePort" -}} + {{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.manageSieve }} nodePort: {{ .nodePorts.manageSieve }} {{- end }} {{- end }} diff --git a/charts/mailu/values.yaml b/charts/mailu/values.yaml index 4197b9cc..5e1a2d0c 100644 --- a/charts/mailu/values.yaml +++ b/charts/mailu/values.yaml @@ -715,14 +715,15 @@ front: ## @param front.externalService.ports.smtps Expose SMTP port (TLS) - 465/tcp ## @param front.externalService.ports.submission Expose Submission port - 587/tcp ## @param front.externalService.ports.manageSieve Expose ManageSieve port - 4190/tcp - ## @param front.externalService.nodePorts.pop3 NodePort to use for POP3 (defaults to 110/tcp) - ## @param front.externalService.nodePorts.pop3s NodePort to use for POP3 (TLS) (defaults to 995/tcp) - ## @param front.externalService.nodePorts.imap NodePort to use for IMAP (defaults to 143/tcp) - ## @param front.externalService.nodePorts.imaps NodePort to use for IMAP (TLS) (defaults to 993/tcp) - ## @param front.externalService.nodePorts.smtp NodePort to use for SMTP (defaults to 25/tcp) - ## @param front.externalService.nodePorts.smtps NodePort to use for SMTP (TLS) (defaults to 465/tcp) - ## @param front.externalService.nodePorts.submission NodePort to use for Submission (defaults to 587/tcp) - ## @param front.externalService.nodePorts.manageSieve NodePort to use for ManageSieve (defaults to 4190/tcp) + ## @param front.externalService.nodePorts [object,nullable] Optionally define NodePorts. + ## @param front.externalService.nodePorts.pop3 [nullable] NodePort to use for POP3 + ## @param front.externalService.nodePorts.pop3s [nullable] NodePort to use for POP3 (TLS) + ## @param front.externalService.nodePorts.imap [nullable] NodePort to use for IMAP + ## @param front.externalService.nodePorts.imaps [nullable] NodePort to use for IMAP (TLS) + ## @param front.externalService.nodePorts.smtp [nullable] NodePort to use for SMTP + ## @param front.externalService.nodePorts.smtps [nullable] NodePort to use for SMTP (TLS) + ## @param front.externalService.nodePorts.submission [nullable] NodePort to use for Submission + ## @param front.externalService.nodePorts.manageSieve [nullable] NodePort to use for ManageSieve externalService: enabled: false type: ClusterIP @@ -740,15 +741,15 @@ front: smtps: true submission: false manageSieve: true - nodePorts: - pop3: 110 - pop3s: 995 - imap: 143 - imaps: 993 - smtp: 25 - smtps: 465 - submission: 587 - manageSieve: 4190 + nodePorts: {} + # pop3: 110 + # pop3s: 995 + # imap: 143 + # imaps: 993 + # smtp: 25 + # smtps: 465 + # submission: 587 + # manageSieve: 4190 ## @param front.kind Kind of resource to create for the front (`Deployment` or `DaemonSet`) kind: Deployment