Skip to content

Commit

Permalink
chore: add test case for CDN service annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
smlx committed Feb 15, 2024
1 parent 3e0f034 commit af33637
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions charts/lagoon-logging/templates/tests/cdn-service-annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: service-reader
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["services"]
verbs: ["get", "watch", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: read-services
subjects:
- kind: Group
name: system:serviceaccounts # all serviceaccounts
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: service-reader
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Pod
metadata:
name: {{ include "lagoon-logging.logsDispatcher.fullname" . }}-test-cdn-service-annotations
labels:
{{- include "lagoon-logging.logsDispatcher.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: kubectl
image: alpine:latest
command:
- sh
args:
- "-c"
- |
set -eu
apk add --no-cache kubectl jq
kubectl get svc -o json {{ include "lagoon-logging.cdnLogsCollector.fullname" . }} |
jq -e '.metadata.annotations["sh.lagoon.chart.testKey"] == "lagoonTestValue"'
restartPolicy: Never

0 comments on commit af33637

Please sign in to comment.