Skip to content

commonLabels helm chart value does not label all resources #8817

Description

@joshuasearle

Description:
The commonLabels helm chart value is not propagated to all resources. As pointed out in #7913, the ability to add labels to k8s resources has many use cases. I'm guessing this was just looked over in the initial PR. I'm not an expert with helm charts, but it looks like we'd just need to use the helper function for the RBAC resources:

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
creationTimestamp: null
name: {{ include "eg.fullname" $ }}-envoy-gateway-role
namespace: {{ $ns | quote }}
rules:
{{ include "eg.rbac.namespaced" $ }}

Repro steps:
This command shows the resources that are unlabelled using mostly default values:

helm template eg oci://docker.io/envoyproxy/gateway-helm:1.8.0-rc.0 --set commonLabels.custom-label=custom-value | yq "{\"kind\": .kind, \"name\": .metadata.name, \"custom-label\": .metadata.labels.custom-label}"
# ...
---
kind: ClusterRole
name: eg-gateway-helm-envoy-gateway-role
custom-label: null
---
kind: ClusterRoleBinding
name: eg-gateway-helm-envoy-gateway-rolebinding
custom-label: null
# ...

I'm happy to have a go at implementing myself if it's helpful

Metadata

Metadata

Assignees

No one assigned

    Labels

    helmPull requests that update helm codehelp wantedExtra attention is needed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions