Skip to content

Commit bacc2b6

Browse files
mayastor-borskrishnaGajabi
andcommitted
chore(bors): merge pull request #802
802: fix: normalize release name for alloy (backport #800) r=tiagolobocastro a=mergify[bot] This PR fixes the release name for alloy. Since Alloy identifiers don't allow hyphen as per the identifier rules. Since release names of helm charts can contain hyphen we handle it by replacing hyphen with underscore. Testing: Tested it by creating a helm release with the name "openebs-mayastor". The alloy pods were seen in crashloopbackoff state. Performed a helm upgrade after doing the required changes in values.yaml. Verified that the alloy pods were in running state. Docs_Update: No Changes Required.<hr>This is an automatic backport of pull request #800 done by [Mergify](https://mergify.com). Co-authored-by: krishnaGajabi <gajbikrishna23@gmail.com>
2 parents 50a9f01 + 4f1af15 commit bacc2b6

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

chart/values.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -731,16 +731,18 @@ alloy:
731731
configMap:
732732
create: true
733733
content: |
734+
{{- $releaseName := .Release.Name | replace "-" "_" -}}
735+
734736
livedebugging {
735737
enabled = {{ .Values.logging_config.debugging }}
736738
}
737739
738-
discovery.kubernetes "{{ .Release.Name }}_pods_name" {
740+
discovery.kubernetes "{{ $releaseName }}_pods_name" {
739741
role = "pod"
740742
}
741743
742-
discovery.relabel "{{ .Release.Name }}_pods_name" {
743-
targets = discovery.kubernetes.{{ .Release.Name }}_pods_name.targets
744+
discovery.relabel "{{ $releaseName }}_pods_name" {
745+
targets = discovery.kubernetes.{{ $releaseName }}_pods_name.targets
744746
745747
{{- $labels := .Values.logging_config.labels }}
746748
{{- if $labels }}
@@ -798,16 +800,16 @@ alloy:
798800
}
799801
}
800802
801-
local.file_match "{{ .Release.Name }}_pod_files" {
802-
path_targets = discovery.relabel.{{ .Release.Name }}_pods_name.output
803+
local.file_match "{{ $releaseName }}_pod_files" {
804+
path_targets = discovery.relabel.{{ $releaseName }}_pods_name.output
803805
}
804806
805-
loki.source.file "{{ .Release.Name }}_pod_logs" {
806-
targets = local.file_match.{{ .Release.Name }}_pod_files.targets
807-
forward_to = [loki.process.{{ .Release.Name }}_process_logs.receiver]
807+
loki.source.file "{{ $releaseName }}_pod_logs" {
808+
targets = local.file_match.{{ $releaseName }}_pod_files.targets
809+
forward_to = [loki.process.{{ $releaseName }}_process_logs.receiver]
808810
}
809811
810-
loki.process "{{ .Release.Name }}_process_logs" {
812+
loki.process "{{ $releaseName }}_process_logs" {
811813
forward_to = [loki.write.default.receiver]
812814
813815
stage.docker { }

0 commit comments

Comments
 (0)