fix!: drop unsupported api versions

- Closes #918
This commit is contained in:
Michael Kriese 2025-01-16 11:12:16 +01:00
parent 2cabd2dd1b
commit 4bfbb48dd3
No known key found for this signature in database
GPG key ID: F8D7748549A5986A
4 changed files with 12 additions and 33 deletions

View file

@ -933,16 +933,15 @@ To comply with the Forgejo helm chart definition of the digest parameter, a "cus
### Ingress ### Ingress
| Name | Description | Value | | Name | Description | Value |
| ------------------------------------ | --------------------------------------------------------------------------- | ----------------- | | ------------------------------------ | -------------------- | ----------------- |
| `ingress.enabled` | Enable ingress | `false` | | `ingress.enabled` | Enable ingress | `false` |
| `ingress.className` | Ingress class name | `nil` | | `ingress.className` | Ingress class name | `nil` |
| `ingress.annotations` | Ingress annotations | `{}` | | `ingress.annotations` | Ingress annotations | `{}` |
| `ingress.hosts[0].host` | Default Ingress host | `git.example.com` | | `ingress.hosts[0].host` | Default Ingress host | `git.example.com` |
| `ingress.hosts[0].paths[0].path` | Default Ingress path | `/` | | `ingress.hosts[0].paths[0].path` | Default Ingress path | `/` |
| `ingress.hosts[0].paths[0].pathType` | Ingress path type | `Prefix` | | `ingress.hosts[0].paths[0].pathType` | Ingress path type | `Prefix` |
| `ingress.tls` | Ingress tls settings | `[]` | | `ingress.tls` | Ingress tls settings | `[]` |
| `ingress.apiVersion` | Specify APIVersion of ingress object. Mostly would only be used for argocd. | |
### Route ### Route
@ -1228,6 +1227,7 @@ You need Forgejo v10+ to use this Helm Chart version.
Forgejo v9 is now EOL. Forgejo v9 is now EOL.
ClusterIP is now emtpy instead of `None` for http and ssh service. ClusterIP is now emtpy instead of `None` for http and ssh service.
Unsupported api versions for `Ingress` and `PodDisruptionBudget` are removed.
### To v10 ### To v10

View file

@ -1,15 +1,7 @@
{{- if .Values.ingress.enabled -}} {{- if .Values.ingress.enabled -}}
{{- $fullName := include "gitea.fullname" . -}} {{- $fullName := include "gitea.fullname" . -}}
{{- $httpPort := .Values.service.http.port -}} {{- $httpPort := .Values.service.http.port -}}
{{- $apiVersion := "extensions/v1beta1" -}} apiVersion: networking.k8s.io/v1/Ingress
{{- if .Values.ingress.apiVersion -}}
{{- $apiVersion = .Values.ingress.apiVersion -}}
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
{{- $apiVersion = "networking.k8s.io/v1" }}
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress" -}}
{{- $apiVersion = "networking.k8s.io/v1beta1" }}
{{- end }}
apiVersion: {{ $apiVersion }}
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ $fullName }} name: {{ $fullName }}
@ -41,19 +33,14 @@ spec:
paths: paths:
{{- range .paths }} {{- range .paths }}
- path: {{ .path }} - path: {{ .path }}
{{- if and .pathType (eq $apiVersion "networking.k8s.io/v1") }} {{- if .pathType }}
pathType: {{ .pathType }} pathType: {{ .pathType }}
{{- end }} {{- end }}
backend: backend:
{{- if eq $apiVersion "networking.k8s.io/v1" }}
service: service:
name: {{ $fullName }}-http name: {{ $fullName }}-http
port: port:
number: {{ $httpPort }} number: {{ $httpPort }}
{{- else }}
serviceName: {{ $fullName }}-http
servicePort: {{ $httpPort }}
{{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View file

@ -1,9 +1,5 @@
{{- if .Values.podDisruptionBudget -}} {{- if .Values.podDisruptionBudget -}}
{{- if .Capabilities.APIVersions.Has "policy/v1" }}
apiVersion: policy/v1 apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget kind: PodDisruptionBudget
metadata: metadata:
name: {{ include "gitea.fullname" . }} name: {{ include "gitea.fullname" . }}

View file

@ -164,7 +164,6 @@ service:
## @param ingress.hosts[0].paths[0].path Default Ingress path ## @param ingress.hosts[0].paths[0].path Default Ingress path
## @param ingress.hosts[0].paths[0].pathType Ingress path type ## @param ingress.hosts[0].paths[0].pathType Ingress path type
## @param ingress.tls Ingress tls settings ## @param ingress.tls Ingress tls settings
## @extra ingress.apiVersion Specify APIVersion of ingress object. Mostly would only be used for argocd.
ingress: ingress:
enabled: false enabled: false
# className: nginx # className: nginx
@ -182,9 +181,6 @@ ingress:
# - secretName: chart-example-tls # - secretName: chart-example-tls
# hosts: # hosts:
# - git.example.com # - git.example.com
# Mostly for argocd or any other CI that uses `helm template | kubectl apply` or similar
# If helm doesn't correctly detect your ingress API version you can set it here.
# apiVersion: networking.k8s.io/v1
## @section Route ## @section Route
## @param route.enabled Enable route ## @param route.enabled Enable route