Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions chart/templates/pgbouncer/pgbouncer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ spec:
{{- if .Values.pgbouncer.podAnnotations }}
{{- toYaml .Values.pgbouncer.podAnnotations | nindent 8 }}
{{- end }}
{{- if .Values.pgbouncer.extraAnnotations }}
{{- toYaml .Values.pgbouncer.extraAnnotations | nindent 8 }}
{{- end }}
spec:
{{- if .Values.pgbouncer.priorityClassName }}
priorityClassName: {{ .Values.pgbouncer.priorityClassName }}
Expand Down
8 changes: 8 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4978,6 +4978,14 @@
"type": "string"
}
},
"extraAnnotations": {
"description": "Add Extra annotations for the PgBouncer Pod.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"podDisruptionBudget": {
"description": "PgBouncer PodDisruptionBudget.",
"type": "object",
Expand Down
2 changes: 2 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,8 @@ pgbouncer:

podAnnotations: {}

extraAnnotations: {}

# Create ServiceAccount
serviceAccount:
# Specifies whether a ServiceAccount should be created
Expand Down
18 changes: 18 additions & 0 deletions tests/charts/other/test_pgbouncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,24 @@ def test_pgbouncer_service_extra_annotations(self):
"foo": "bar",
} == jmespath.search("metadata.annotations", docs[0])

def test_pgbouncer_pod_extra_annotations(self):
expected = {"foo": "bar"}
docs = render_chart(
values={
"pgbouncer": {"enabled": True, "extraAnnotations": expected},
},
show_only=["templates/pgbouncer/pgbouncer-deployment.yaml"],
)

actual = jmespath.search(
"spec.template.metadata.annotations",
docs[0],
)

for key, val in expected.items():
assert key in actual
assert val == actual[key]

@pytest.mark.parametrize(
"revision_history_limit, global_revision_history_limit",
[(8, 10), (10, 8), (8, None), (None, 10), (None, None)],
Expand Down