Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[collector] resolve YAML formatting issue with additionalLabels #1460

Conversation

shmileee
Copy link

@shmileee shmileee commented Dec 10, 2024

This change broke the way how additionalLabels are formatted.

Given the following values.yaml:

...
  additionalLabels:
    example: "test"

The output is:

---
# Source: opentelemetry-collector/charts/opentelemetry-collector/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: opentelemetry-collector
  labels:
    helm.sh/chart: opentelemetry-collector-0.110.3
    app.kubernetes.io/name: opentelemetry-collector
    app.kubernetes.io/instance: opentelemetry-collector
    app.kubernetes.io/version: "0.114.0"
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: agent-collectorexample: test             <------ HERE
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: opentelemetry-collector
subjects:
- kind: ServiceAccount
  name: opentelemetry-collector
  namespace: otel
Error: YAML parse error on opentelemetry-collector/charts/opentelemetry-collector/templates/clusterrole.yaml: error converting YAML to JSON: yaml: line 11: mapping values are not allowed in this context
helm.go:86: 2024-12-10 12:25:30.148781 +0100 CET m=+0.148933543 [debug] error converting YAML to JSON: yaml: line 11: mapping values are not allowed in this context
$ yq '.dependencies[0]' Chart.yaml 
name: opentelemetry-collector
version: 0.110.3
repository: https://open-telemetry.github.io/opentelemetry-helm-charts

Confirmed the suggested fix works by monkey-patching both the affected (0.110.3) and the latest (0.110.5) version of the chart.

Copy link

linux-foundation-easycla bot commented Dec 10, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@TylerHelmuth
Copy link
Member

@shmileee thanks for the PR, we'll fix this via #1445 (comment) as it was first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants