Skip to content

helm chart podlabels and deployment labels can't be passed from values file #558

Open
@prashanth-cbsi

Description

@prashanth-cbsi

Description

In the file charts/nri-metadata-injection/templates/deployment.yaml we have included {{- include "newrelic.common.labels" . | nindent 4 }} and for pods {{- include "newrelic.common.labels.podLabels" . | nindent 8 }} , but these are not defined in the file charts/nri-metadata-injection/templates/_helpers.tpl
Also add labels and podLabels to be able to read from values file.

Expected Behavior

in the file charts/nri-metadata-injection/templates/deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "newrelic.common.naming.fullname" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include ".Values.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicas }}
  selector:
    matchLabels:
      {{- /* We cannot use the common library here because of a legacy issue */}}
      {{- /* `selector` is immutable  and the previous chart did not have all the idiomatic labels */}}
      app.kubernetes.io/name: {{ include "newrelic.common.naming.name" . }}
  template:
    metadata:
      {{- if .Values.podAnnotations }}
      annotations:
        {{- toYaml .Values.podAnnotations | nindent 8 }}
      {{- end }}
      labels:
        {{- include ".Values.podLabels" . | nindent 8 }}

For Maintainers Only or Hero Triaging this bug

Suggested Priority : P3
Suggested T-Shirt size : S

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions