Skip to content

Commit

Permalink
Merge branch 'BRASS-594' into 'master'
Browse files Browse the repository at this point in the history
Allow specifying arbitrary annotations

Closes BRASS-594

See merge request devops-program/helm-charts!363
  • Loading branch information
timothynguyen90 committed Nov 18, 2022
2 parents 6251792 + 85c99e5 commit c88e87d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/ping-devops/templates/pinglib/_service-cluster.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
{{ include "pinglib.metadata.annotations" . | nindent 2 }}
{{- if $v.services.clusterExternalDNSHostname }}
annotations:
{{ include "pinglib.metadata.annotations" . | nindent 2 }}
external-dns.alpha.kubernetes.io/hostname: {{ $v.services.clusterExternalDNSHostname }}
{{- end }}
name: {{ include "pinglib.fullclusterservicename" . }}
Expand Down
1 change: 1 addition & 0 deletions charts/ping-devops/templates/pinglib/_service.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
{{ include "pinglib.metadata.annotations" . | nindent 2 }}
{{- if $v.services.dataExternalDNSHostname }}
annotations:
{{ include "pinglib.metadata.annotations" . | nindent 2 }}
external-dns.alpha.kubernetes.io/hostname: {{ $v.services.dataExternalDNSHostname }}
{{- end }}
name: {{ include "pinglib.fullname" . }}
Expand Down
42 changes: 42 additions & 0 deletions helm-tests/template-tests/pd-annotation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This test covers setting annotation for PD.
### SECTION:PARAMETERS ###
releaseName: annotation
# Set skipTest to true to make the script skip this test
skipTest: false
### SECTION:VALUES ###
# Set typical Helm values here
pingdirectory:
enabled: true
annotations:
external-dns.alpha.kubernetes.io/myannotation: "mycustomannotation"
services:
clusterExternalDNSHostname: set1.west.ping-multi-cluster.com
dataExternalDNSHostname: us.west.ping-multi-cluster.com

### SECTION:EXPECTED ###

# Validate that expected annotations are generated
apiVersion: v1
kind: Service
metadata:
annotations:
external-dns.alpha.kubernetes.io/hostname: set1.west.ping-multi-cluster.com
external-dns.alpha.kubernetes.io/myannotation: mycustomannotation
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
name: annotation-pingdirectory-cluster
---
apiVersion: v1
kind: Service
metadata:
annotations:
external-dns.alpha.kubernetes.io/hostname: us.west.ping-multi-cluster.com
external-dns.alpha.kubernetes.io/myannotation: mycustomannotation
name: annotation-pingdirectory
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
external-dns.alpha.kubernetes.io/myannotation: mycustomannotation
name: annotation-pingdirectory
---

0 comments on commit c88e87d

Please sign in to comment.