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

Commit

Permalink
[apm-server]Fix fullnameOverride setting (#508)
Browse files Browse the repository at this point in the history
* [apm-server]Fix fullnameOverride setting

* fixes #481

* Typo

* Add EOF
  • Loading branch information
kawat55 authored Mar 6, 2020
1 parent d27c886 commit 66602b9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apm-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "apm.fullname" }}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-"}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}

{{/*
Return the appropriate apiVersion for ingress.
Expand Down
18 changes: 18 additions & 0 deletions apm-server/tests/apmserver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,21 @@ def test_priority_class_name():
"priorityClassName"
]
assert priority_class_name == "highest"


def test_setting_fullnameOverride():
config = """
fullnameOverride: "apm-server-custom"
"""
r = helm_template(config)

custom_name = "apm-server-custom"
assert custom_name in r["deployment"]
assert custom_name in r["service"]

assert (
r["deployment"][custom_name]["spec"]["template"]["spec"]["containers"][0][
"name"
]
== project
)

0 comments on commit 66602b9

Please sign in to comment.