Skip to content

Commit

Permalink
Fix: check for the 'ingress' resource, rather than the API itself
Browse files Browse the repository at this point in the history
Prevents the error reported in sciencemesh/charts#15 (review)
when the ingress resource is not present on the cluster
  • Loading branch information
SamuAlfageme committed May 11, 2021
1 parent 6f47503 commit 5cbe763
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 20 deletions.
8 changes: 2 additions & 6 deletions revad/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: revad
description: The Reva daemon (revad) helm chart
type: application
version: 1.3.0
version: 1.3.1
appVersion: v1.7.0
kubeVersion: ">= 1.14.0"
icon: https://reva.link/logo.svg
Expand All @@ -23,11 +23,7 @@ keywords:
- sync-and-share
annotations:
artifacthub.io/changes: |
- "Add the ingress resource templates from sciencemesh/iop"
- "Generate the right 'apiVersion' for ingress resources when using k8s versions >= 1.19"
- "Explicitly drop support for Kubernetes versions older than 1.14"
- "Bump revad's version to v1.7.0"
- "Add maintainters to the chart"
- "Fix: check for the 'ingress' resource, rather than the API itself"
artifacthub.io/images: |
- name: revad
image: cs3org/revad:v1.7.0
4 changes: 2 additions & 2 deletions revad/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{/*
Return the appropriate apiVersion for ingress.
*/}}
{{- define "revad.ingressapiVersion" -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
{{- define "revad.ingress.apiVersion" -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/ingress" }}
{{- print "networking.k8s.io/v1" -}}
{{- else }}
{{- print "networking.k8s.io/v1beta1" -}}
Expand Down
4 changes: 2 additions & 2 deletions revad/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.ingress.enabled }}
{{- range $service, $ingress := .Values.ingress.services }}
apiVersion: {{ template "revad.ingressapiVersion" $ }}
apiVersion: {{ template "revad.ingress.apiVersion" $ }}
kind: Ingress
metadata:
name: {{ template "revad.fullname" $ }}-{{ $service }}
Expand All @@ -17,7 +17,7 @@ spec:
paths:
- path: {{ $ingress.path }}
backend:
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/ingress" }}
service:
name: {{ template "revad.fullname" $ }}
port:
Expand Down
11 changes: 4 additions & 7 deletions wopiserver/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ apiVersion: v2
name: wopiserver
description: A Vendor-neutral Web-application Open Platform Interface (WOPI) gateway for EFSS systems
type: application
version: 0.2.3
appVersion: 6.5.0
version: 0.2.4
appVersion: v6.5.0
kubeVersion: ">= 1.14.0"
home: https://github.com/cs3org/wopiserver
sources:
- https://github.com/cs3org/wopiserver
- https://github.com/cs3org/wopibridge
maintainers:
- name: SamuAlfageme
email: samuel.alfageme.sainz@cern.ch
Expand All @@ -18,11 +19,7 @@ keywords:
- efss
annotations:
artifacthub.io/changes: |
- "Fix WOPI Server, Bridge version in Chart.yaml"
- "Rename 'revahost' to 'revagateway' in WOPI Server config"
- "Set 'CODIMD_{INT,EXT}_URL' explicit placeholders to prevent WB CrashLoopBackOff"
- "Add 'codimd_apikey' shared Secret to the WOPI Bridge deployment"
- "Generate the right 'apiVersion' for ingress resources when using k8s versions >= 1.19"
- "Fix: check for the 'ingress' resource, rather than the API itself"
artifacthub.io/images: |
- name: wopiserver
image: cs3org/wopiserver:v6.5.0
Expand Down
2 changes: 1 addition & 1 deletion wopiserver/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
Return the appropriate apiVersion for ingress.
*/}}
{{- define "wopiserver.ingress.apiVersion" -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/ingress" }}
{{- print "networking.k8s.io/v1" -}}
{{- else }}
{{- print "networking.k8s.io/v1beta1" -}}
Expand Down
2 changes: 1 addition & 1 deletion wopiserver/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
paths:
- path: {{ .Values.ingress.path }}
backend:
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/ingress" }}
service:
name: {{ template "wopiserver.fullname" . }}
port:
Expand Down
2 changes: 1 addition & 1 deletion wopiserver/templates/wopibridge/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
paths:
- path: {{ .ingress.path }}
backend:
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/ingress" }}
service:
name: {{ template "wopiserver.fullname" $ }}-{{ .name }}
port:
Expand Down

0 comments on commit 5cbe763

Please sign in to comment.