Skip to content

Commit

Permalink
Merge branch 'PDI-1357' into 'master'
Browse files Browse the repository at this point in the history
PDI-1357: Update _ingress.tpl to Use spec.ingressClassName Instead of Deprecated Annotations

Closes PDI-1357

See merge request devops-program/helm-charts!418
  • Loading branch information
erikostien-pingidentity committed Jan 12, 2024
2 parents aa0acd6 + a570cdf commit 312d9dd
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
3 changes: 3 additions & 0 deletions charts/ping-devops/templates/pinglib/_ingress.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ metadata:
name: {{ include "pinglib.fullname" . }}
annotations: {{ toYaml $v.ingress.annotations | nindent 4 }}
spec:
{{- if $v.ingress.spec.ingressClassName }}
ingressClassName: {{ $v.ingress.spec.ingressClassName }}
{{- end}}
{{- if $v.ingress.tls }}
tls:
{{- range $v.ingress.tls }}
Expand Down
9 changes: 6 additions & 3 deletions charts/ping-devops/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,19 @@ global:
#
# @param global.ingress.annotations
# @default {}
#
# @param global.ingress.spec.ingressClassName
############################################################
ingress:
enabled: false
addReleaseNameToHost: subdomain
defaultDomain: example.com
defaultTlsSecret:
annotations: {}
# nginx example
# nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
# kubernetes.io/ingress.class: "nginx-public"
# nginx annotation example with spec classname
# nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
# spec:
# ingressClassName: nginx-public

############################################################
# Internal Certificates
Expand Down
26 changes: 26 additions & 0 deletions helm-tests/template-tests/ingress-classname.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This test is meant to show a simple example of how to format
# a test file for the test_helm_template.py script.

### SECTION:PARAMETERS ###
# The PARAMETERS section is required.
# If the releaseName parameter is not set, then a default release name
# matching the name of the file (without the extension) will be used.
releaseName: ingress-classname
# Set skipTest to true to make the script skip this test
skipTest: false
### SECTION:VALUES ###
global:
ingress:
enabled: true
spec:
ingressClassName: nginx-public
pingfederate-admin:
enabled: true
### SECTION:EXPECTED ###
# Validate that the ingress class name is included in generated yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-classname-pingfederate-admin
spec:
ingressClassName: nginx-public

0 comments on commit 312d9dd

Please sign in to comment.