Skip to content
Merged
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
4 changes: 4 additions & 0 deletions chart/templates/configmaps/statsd-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ metadata:
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.statsd.configMapAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
mappings.yml: |-
{{- if .Values.statsd.overrideMappings }}
Expand Down
4 changes: 4 additions & 0 deletions chart/templates/configmaps/webserver-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ metadata:
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.webserver.configMapAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
webserver_config.py: |-
{{- tpl .Values.webserver.webserverConfig . | nindent 4 }}
Expand Down
16 changes: 16 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3706,6 +3706,14 @@
"x-docsSection": "Webserver",
"additionalProperties": false,
"properties": {
"configMapAnnotations": {
"description": "Extra annotations to apply to the webserver configmap.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"hostAliases": {
"description": "HostAliases for the webserver pod.",
"items": {
Expand Down Expand Up @@ -4807,6 +4815,14 @@
"x-docsSection": "StatsD",
"additionalProperties": false,
"properties": {
"configMapAnnotations": {
"description": "Extra annotations to apply to the statsd configmap.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"enabled": {
"description": "Enable StatsD.",
"type": "boolean",
Expand Down
5 changes: 5 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,8 @@ migrateDatabaseJob:

# Airflow webserver settings
webserver:
# Add custom annotations to the webserver configmap
configMapAnnotations: {}
# hostAliases for the webserver pod
hostAliases: []
# - ip: "127.0.0.1"
Expand Down Expand Up @@ -1671,6 +1673,9 @@ flower:

# StatsD settings
statsd:
# Add custom annotations to the statsd configmap
configMapAnnotations: {}

enabled: true
# Max number of old replicasets to retain
revisionHistoryLimit: ~
Expand Down
14 changes: 14 additions & 0 deletions helm_tests/other/test_statsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,20 @@ def test_should_add_custom_env_variables(self):

assert jmespath.search("spec.template.spec.containers[0].env", docs) == [env1]

def test_should_add_annotations_to_statsd_configmap(self):
docs = render_chart(
values={
"statsd": {
"enabled": True,
"configMapAnnotations": {"test_annotation": "test_annotation_value"},
},
},
show_only=["templates/configmaps/statsd-configmap.yaml"],
)[0]

assert "annotations" in jmespath.search("metadata", docs)
assert jmespath.search("metadata.annotations", docs)["test_annotation"] == "test_annotation_value"


class TestStatsdServiceAccount:
"""Tests statsd service account."""
Expand Down
14 changes: 14 additions & 0 deletions helm_tests/webserver/test_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,20 @@ def test_webserver_pod_hostaliases(self):
assert "127.0.0.1" == jmespath.search("spec.template.spec.hostAliases[0].ip", docs[0])
assert "foo.local" == jmespath.search("spec.template.spec.hostAliases[0].hostnames[0]", docs[0])

def test_should_add_annotations_to_webserver_configmap(self):
docs = render_chart(
values={
"webserver": {
"webserverConfig": "CSRF_ENABLED = True # {{ .Release.Name }}",
"configMapAnnotations": {"test_annotation": "test_annotation_value"},
},
},
show_only=["templates/configmaps/webserver-configmap.yaml"],
)

assert "annotations" in jmespath.search("metadata", docs[0])
assert jmespath.search("metadata.annotations", docs[0])["test_annotation"] == "test_annotation_value"


class TestWebserverService:
"""Tests webserver service."""
Expand Down