Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Fix Mismatch Between Service Selector and Pod Labels when using Helm Aliases in Kibana #493

Merged
merged 4 commits into from
Mar 24, 2020
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: 2 additions & 2 deletions kibana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ spec:
{{ toYaml .Values.updateStrategy | indent 4 }}
selector:
matchLabels:
app: kibana
app: {{ .Chart.Name }}
release: {{ .Release.Name | quote }}
template:
metadata:
labels:
app: kibana
app: {{ .Chart.Name }}
release: {{ .Release.Name | quote }}
{{- range $key, $value := .Values.labels }}
{{ $key }}: {{ $value | quote }}
Expand Down
25 changes: 25 additions & 0 deletions kibana/tests/kibana_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,31 @@ def test_adding_pod_labels():
)


def test_service_to_pod_label_selectors():
config = ""

r = helm_template(config)

assert all(
l in r["deployment"][name]["spec"]["template"]["metadata"]["labels"].items()
for l in r["service"][name]["spec"]["selector"].items()
)


def test_service_to_pod_label_selectors_with_custom_labels():
config = """
labels:
app.kubernetes.io/name: kibana
"""

r = helm_template(config)

assert all(
l in r["deployment"][name]["spec"]["template"]["metadata"]["labels"].items()
for l in r["service"][name]["spec"]["selector"].items()
)


def test_adding_a_secret_mount_with_subpath():
config = """
secretMounts:
Expand Down