From 4bfbb48dd3c01b26cb1163ef4d0eadbd5160a7c0 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Thu, 16 Jan 2025 11:12:16 +0100 Subject: [PATCH] fix!: drop unsupported api versions - Closes #918 --- README.md | 20 ++++++++++---------- templates/gitea/ingress.yaml | 17 ++--------------- templates/gitea/poddisruptionbudget.yaml | 4 ---- values.yaml | 4 ---- 4 files changed, 12 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index e22c6df..9346ccd 100644 --- a/README.md +++ b/README.md @@ -933,16 +933,15 @@ To comply with the Forgejo helm chart definition of the digest parameter, a "cus ### Ingress -| Name | Description | Value | -| ------------------------------------ | --------------------------------------------------------------------------- | ----------------- | -| `ingress.enabled` | Enable ingress | `false` | -| `ingress.className` | Ingress class name | `nil` | -| `ingress.annotations` | Ingress annotations | `{}` | -| `ingress.hosts[0].host` | Default Ingress host | `git.example.com` | -| `ingress.hosts[0].paths[0].path` | Default Ingress path | `/` | -| `ingress.hosts[0].paths[0].pathType` | Ingress path type | `Prefix` | -| `ingress.tls` | Ingress tls settings | `[]` | -| `ingress.apiVersion` | Specify APIVersion of ingress object. Mostly would only be used for argocd. | | +| Name | Description | Value | +| ------------------------------------ | -------------------- | ----------------- | +| `ingress.enabled` | Enable ingress | `false` | +| `ingress.className` | Ingress class name | `nil` | +| `ingress.annotations` | Ingress annotations | `{}` | +| `ingress.hosts[0].host` | Default Ingress host | `git.example.com` | +| `ingress.hosts[0].paths[0].path` | Default Ingress path | `/` | +| `ingress.hosts[0].paths[0].pathType` | Ingress path type | `Prefix` | +| `ingress.tls` | Ingress tls settings | `[]` | ### Route @@ -1228,6 +1227,7 @@ You need Forgejo v10+ to use this Helm Chart version. Forgejo v9 is now EOL. ClusterIP is now emtpy instead of `None` for http and ssh service. +Unsupported api versions for `Ingress` and `PodDisruptionBudget` are removed. ### To v10 diff --git a/templates/gitea/ingress.yaml b/templates/gitea/ingress.yaml index 7252cb7..fea418e 100644 --- a/templates/gitea/ingress.yaml +++ b/templates/gitea/ingress.yaml @@ -1,15 +1,7 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "gitea.fullname" . -}} {{- $httpPort := .Values.service.http.port -}} -{{- $apiVersion := "extensions/v1beta1" -}} -{{- 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 }} +apiVersion: networking.k8s.io/v1/Ingress kind: Ingress metadata: name: {{ $fullName }} @@ -41,19 +33,14 @@ spec: paths: {{- range .paths }} - path: {{ .path }} - {{- if and .pathType (eq $apiVersion "networking.k8s.io/v1") }} + {{- if .pathType }} pathType: {{ .pathType }} {{- end }} backend: - {{- if eq $apiVersion "networking.k8s.io/v1" }} service: name: {{ $fullName }}-http port: number: {{ $httpPort }} - {{- else }} - serviceName: {{ $fullName }}-http - servicePort: {{ $httpPort }} - {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/templates/gitea/poddisruptionbudget.yaml b/templates/gitea/poddisruptionbudget.yaml index 04dcecd..d40a166 100644 --- a/templates/gitea/poddisruptionbudget.yaml +++ b/templates/gitea/poddisruptionbudget.yaml @@ -1,9 +1,5 @@ {{- if .Values.podDisruptionBudget -}} -{{- if .Capabilities.APIVersions.Has "policy/v1" }} apiVersion: policy/v1 -{{- else }} -apiVersion: policy/v1beta1 -{{- end }} kind: PodDisruptionBudget metadata: name: {{ include "gitea.fullname" . }} diff --git a/values.yaml b/values.yaml index 7a302aa..79256b3 100644 --- a/values.yaml +++ b/values.yaml @@ -164,7 +164,6 @@ service: ## @param ingress.hosts[0].paths[0].path Default Ingress path ## @param ingress.hosts[0].paths[0].pathType Ingress path type ## @param ingress.tls Ingress tls settings -## @extra ingress.apiVersion Specify APIVersion of ingress object. Mostly would only be used for argocd. ingress: enabled: false # className: nginx @@ -182,9 +181,6 @@ ingress: # - secretName: chart-example-tls # hosts: # - 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 ## @param route.enabled Enable route