Files
helm-gitea/unittests/helm/deployment/deprecations.yaml
T
volker.raschekandCopilot 20de800294 feat(deployment)!: split resources into deployment.gitea.resources and deployment.resources
The top-level `resources` value was applied to the Gitea container only, while its name suggested it covered the
whole pod. Kubernetes meanwhile supports pod-level resources, so a single ambiguous key can no longer express
both scopes.

Container-scoped limits and requests now live in `deployment.gitea.resources`, next to `deployment.gitea.env`,
and the new `deployment.resources` maps to the pod-level `resources` field. The pod-level block is only rendered
when set, because the field is not accepted by older API servers and would otherwise be rejected on clusters
that do not support it yet. The GOMAXPROCS derivation follows the container-scoped value and tolerates an unset
`deployment.gitea.resources`, which defaults to `null`.

The `deployment` section marker in `values.yaml` is restored as well. Without it the generated README lost its
`### deployment` heading and the manually maintained table of contents pointed at a non-existing anchor, which
made `markdownlint` fail.

BREAKING CHANGE: `resources` no longer exists. Use `deployment.gitea.resources` for container limits and
requests, or `deployment.resources` for pod-level resources. Installations that still set `resources` will fail
unless `checkDeprecation` is set to `false`.

Co-authored-by: Copilot <copilot@github.com>
2026-09-04 11:40:09 +02:00

83 lines
2.7 KiB
YAML

suite: deprecation template (deployment)
release:
name: gitea-unittests
namespace: testing
templates:
- templates/gitea/deprecation.yaml
tests:
- it: renders nothing with the default values
asserts:
- hasDocuments:
count: 0
- it: fails when the removed `affinity` value is set
set:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
asserts:
- failedTemplate:
errorMessage: "`affinity` does no longer exist. Please refer to the changelog and configure `deployment.affinity` instead."
- it: fails when the removed `deployment.env` value is set
set:
deployment.env:
- name: VARIABLE
value: my-value
asserts:
- failedTemplate:
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: fails when the removed `nodeSelector` value is set
set:
nodeSelector:
foo: bar
asserts:
- failedTemplate:
errorMessage: "`nodeSelector` does no longer exist. Please refer to the changelog and configure `deployment.nodeSelector` instead."
- it: fails when the removed `priorityClassName` value is set
set:
priorityClassName: high-priority
asserts:
- failedTemplate:
errorMessage: "`priorityClassName` does no longer exist. Please refer to the changelog and configure `deployment.priorityClassName` instead."
- it: fails when the removed `resources` value is set
set:
resources:
limits:
cpu: 100m
asserts:
- failedTemplate:
errorMessage: "`resources` does no longer exist. Please refer to the changelog and configure `deployment.gitea.resources` instead."
- it: skips the deprecation checks when `checkDeprecation` is disabled
set:
checkDeprecation: false
affinity:
nodeAffinity: {}
deployment.env:
- name: VARIABLE
value: my-value
dnsConfig:
nameservers:
- 192.0.2.1
nodeSelector:
foo: bar
priorityClassName: high-priority
resources:
limits:
cpu: 100m
asserts:
- hasDocuments:
count: 0