feat(deployment)!: move dnsConfig to deployment.dnsConfig
`dnsConfig` was a top-level value although it exclusively configures the pod spec of the Gitea Deployment. With `affinity` and `env` already moved into the `deployment` dict, keeping `dnsConfig` at the root level leaves the Deployment configuration split across two places and makes it harder to see which values end up in the rendered pod spec. Moving it into the `deployment` dict continues the consolidation of Deployment-scoped values and keeps the values structure predictable for the remaining pod-level settings. A deprecation check is added so that existing installations fail fast with an actionable error message. Without it, a custom DNS configuration would be dropped silently, which typically surfaces much later as unexplained name resolution failures inside the Gitea pod. BREAKING CHANGE: `dnsConfig` no longer exists. Use `deployment.dnsConfig` instead. Installations that still set `dnsConfig` will fail unless `checkDeprecation` is set to `false`. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -1128,13 +1128,13 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
|||||||
| `nodeSelector` | NodeSelector for the deployment | `{}` |
|
| `nodeSelector` | NodeSelector for the deployment | `{}` |
|
||||||
| `tolerations` | Tolerations for the deployment | `[]` |
|
| `tolerations` | Tolerations for the deployment | `[]` |
|
||||||
| `topologySpreadConstraints` | TopologySpreadConstraints for the deployment | `[]` |
|
| `topologySpreadConstraints` | TopologySpreadConstraints for the deployment | `[]` |
|
||||||
| `dnsConfig` | dnsConfig for the deployment | `{}` |
|
|
||||||
| `priorityClassName` | priorityClassName for the deployment | `""` |
|
| `priorityClassName` | priorityClassName for the deployment | `""` |
|
||||||
| `deployment.enabled` | Enable the deployment of Gitea. | `true` |
|
| `deployment.enabled` | Enable the deployment of Gitea. | `true` |
|
||||||
| `deployment.annotations` | Annotations for the Gitea deployment to be created | `{}` |
|
| `deployment.annotations` | Annotations for the Gitea deployment to be created | `{}` |
|
||||||
| `deployment.labels` | Labels for the deployment | `{}` |
|
| `deployment.labels` | Labels for the deployment | `{}` |
|
||||||
| `deployment.affinity` | Affinity for the deployment. | `{}` |
|
| `deployment.affinity` | Affinity for the deployment. | `{}` |
|
||||||
| `deployment.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` |
|
| `deployment.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` |
|
||||||
|
| `deployment.dnsConfig` | dnsConfig of the Gitea deployment. | `{}` |
|
||||||
| `deployment.gitea.env` | Additional environment variables to pass to the Gitea container. | `[]` |
|
| `deployment.gitea.env` | Additional environment variables to pass to the Gitea container. | `[]` |
|
||||||
|
|
||||||
### Secret
|
### Secret
|
||||||
|
|||||||
@@ -439,9 +439,9 @@ spec:
|
|||||||
tolerations:
|
tolerations:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.dnsConfig }}
|
{{- if .Values.deployment.dnsConfig }}
|
||||||
dnsConfig:
|
dnsConfig:
|
||||||
{{- toYaml .Values.dnsConfig | nindent 8 }}
|
{{- toYaml .Values.deployment.dnsConfig | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: init
|
- name: init
|
||||||
|
|||||||
@@ -49,4 +49,9 @@
|
|||||||
{{- if .Values.deployment.env -}}
|
{{- if .Values.deployment.env -}}
|
||||||
{{- fail "`deployment.env` does no longer exist. Please refer to the changelog and configure `deployment.gitea.env` instead." -}}
|
{{- fail "`deployment.env` does no longer exist. Please refer to the changelog and configure `deployment.gitea.env` instead." -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* DNS CONFIG */}}
|
||||||
|
{{- if .Values.dnsConfig -}}
|
||||||
|
{{- fail "`dnsConfig` does no longer exist. Please refer to the changelog and configure `deployment.dnsConfig` instead." -}}
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -103,6 +103,29 @@ tests:
|
|||||||
operator: In
|
operator: In
|
||||||
values:
|
values:
|
||||||
- linux
|
- linux
|
||||||
|
- it: dnsConfig is undefined
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
asserts:
|
||||||
|
- notExists:
|
||||||
|
path: spec.template.spec.dnsConfig
|
||||||
|
- it: dnsConfig is defined
|
||||||
|
template: templates/gitea/deployment.yaml
|
||||||
|
set:
|
||||||
|
deployment.dnsConfig:
|
||||||
|
nameservers:
|
||||||
|
- 192.0.2.1
|
||||||
|
options:
|
||||||
|
- name: ndots
|
||||||
|
value: "2"
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.dnsConfig
|
||||||
|
value:
|
||||||
|
nameservers:
|
||||||
|
- 192.0.2.1
|
||||||
|
options:
|
||||||
|
- name: ndots
|
||||||
|
value: "2"
|
||||||
|
|
||||||
- it: "injects TMP_EXISTING_ENVS_FILE as environment variable to 'init-app-ini' init container"
|
- it: "injects TMP_EXISTING_ENVS_FILE as environment variable to 'init-app-ini' init container"
|
||||||
template: templates/gitea/deployment.yaml
|
template: templates/gitea/deployment.yaml
|
||||||
|
|||||||
@@ -31,6 +31,14 @@ tests:
|
|||||||
asserts:
|
asserts:
|
||||||
- failedTemplate:
|
- failedTemplate:
|
||||||
errorMessage: "`deployment.env` does no longer exist. Please refer to the changelog and configure `deployment.gitea.env` instead."
|
errorMessage: "`deployment.env` does no longer exist. Please refer to the changelog and configure `deployment.gitea.env` instead."
|
||||||
|
- it: fails when the removed `dnsConfig` value is set
|
||||||
|
set:
|
||||||
|
dnsConfig:
|
||||||
|
nameservers:
|
||||||
|
- 192.0.2.1
|
||||||
|
asserts:
|
||||||
|
- failedTemplate:
|
||||||
|
errorMessage: "`dnsConfig` does no longer exist. Please refer to the changelog and configure `deployment.dnsConfig` instead."
|
||||||
- it: skips the deprecation checks when `checkDeprecation` is disabled
|
- it: skips the deprecation checks when `checkDeprecation` is disabled
|
||||||
set:
|
set:
|
||||||
checkDeprecation: false
|
checkDeprecation: false
|
||||||
@@ -39,6 +47,9 @@ tests:
|
|||||||
deployment.env:
|
deployment.env:
|
||||||
- name: VARIABLE
|
- name: VARIABLE
|
||||||
value: my-value
|
value: my-value
|
||||||
|
dnsConfig:
|
||||||
|
nameservers:
|
||||||
|
- 192.0.2.1
|
||||||
asserts:
|
asserts:
|
||||||
- hasDocuments:
|
- hasDocuments:
|
||||||
count: 0
|
count: 0
|
||||||
|
|||||||
+11
-3
@@ -322,9 +322,6 @@ tolerations: []
|
|||||||
## @param topologySpreadConstraints TopologySpreadConstraints for the deployment
|
## @param topologySpreadConstraints TopologySpreadConstraints for the deployment
|
||||||
topologySpreadConstraints: []
|
topologySpreadConstraints: []
|
||||||
|
|
||||||
## @param dnsConfig dnsConfig for the deployment
|
|
||||||
dnsConfig: {}
|
|
||||||
|
|
||||||
## @param priorityClassName priorityClassName for the deployment
|
## @param priorityClassName priorityClassName for the deployment
|
||||||
priorityClassName: ""
|
priorityClassName: ""
|
||||||
|
|
||||||
@@ -357,6 +354,17 @@ deployment:
|
|||||||
# values:
|
# values:
|
||||||
# - amd64
|
# - amd64
|
||||||
|
|
||||||
|
## @param deployment.dnsConfig dnsConfig of the Gitea deployment.
|
||||||
|
dnsConfig: {}
|
||||||
|
# nameservers:
|
||||||
|
# - 192.0.2.1 # this is an example
|
||||||
|
# searches:
|
||||||
|
# - ns1.svc.cluster-domain.example
|
||||||
|
# - my.dns.search.suffix
|
||||||
|
# options:
|
||||||
|
# - name: ndots
|
||||||
|
# value: "2"
|
||||||
|
# - name: edns0
|
||||||
|
|
||||||
gitea:
|
gitea:
|
||||||
## @param deployment.gitea.env Additional environment variables to pass to the gitea container.
|
## @param deployment.gitea.env Additional environment variables to pass to the gitea container.
|
||||||
|
|||||||
Reference in New Issue
Block a user