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

fix(collector): Whitespace/newline issues regarding additionalLabels #1445

Merged
merged 7 commits into from
Dec 11, 2024

Conversation

brdotv2
Copy link
Contributor

@brdotv2 brdotv2 commented Dec 5, 2024

When providing values to the additionalLabels config object, they are added inline with the last label defined in opentelemetry-collector.labels in _helpers.tpl which makes the deployment of the Chart fail.

# values.yaml
global:
  test: templated-value

mode: deployment

additionalLabels:
  testLabel: "{{ .Values.global.test }}"
  someLabel: "someValue"

Current output:

---
# Source: opentelemetry-collector/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: release-name-opentelemetry-collector
  namespace: default
  labels:
    helm.sh/chart: opentelemetry-collector-0.110.4
    app.kubernetes.io/name: opentelemetry-collector
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/version: "0.114.0"
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: standalone-collectorsomeLabel: someValue     <------ issue
    testLabel: 'templated-value'
---

By wrapping the include in an if statement, the labels are printed out correctly with the expected newline.

---
# Source: opentelemetry-collector/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: release-name-opentelemetry-collector
  namespace: default
  labels:
    helm.sh/chart: opentelemetry-collector-0.110.4
    app.kubernetes.io/name: opentelemetry-collector
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/version: "0.114.0"
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: standalone-collector
    someLabel: someValue
    testLabel: 'templated-value'
---

Copy link

linux-foundation-easycla bot commented Dec 5, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@brdotv2 brdotv2 force-pushed the fix/additional-labels branch from 17c0725 to 2625c3c Compare December 5, 2024 07:42
@brdotv2 brdotv2 force-pushed the fix/additional-labels branch from 2a6b549 to 09d69fa Compare December 6, 2024 08:40
@brdotv2 brdotv2 requested a review from TylerHelmuth December 6, 2024 08:40
@povilasv
Copy link
Contributor

povilasv commented Dec 6, 2024

Please run make generate-examples CHARTS=opentelemetry-collector and commit the changes

@brdotv2
Copy link
Contributor Author

brdotv2 commented Dec 9, 2024

Please run make generate-examples CHARTS=opentelemetry-collector and commit the changes

i have, but there are no changes. Do you maybe want me to update some of the example values.yaml files to include some values for additionalLabels? @povilasv

@povilasv
Copy link
Contributor

povilasv commented Dec 9, 2024

I think you forgot to bump the patch version, that's why not changes

@TylerHelmuth
Copy link
Member

@brdotv2 we've been merging other PRs but if you can get the patch version bumped and examples generated one more time I'll merge this next

@brdotv2 brdotv2 force-pushed the fix/additional-labels branch from e671bbb to 4879b82 Compare December 11, 2024 08:27
@brdotv2
Copy link
Contributor Author

brdotv2 commented Dec 11, 2024

@TylerHelmuth done, thanks!

@TylerHelmuth TylerHelmuth merged commit 4c828dd into open-telemetry:main Dec 11, 2024
3 checks passed
@brdotv2 brdotv2 deleted the fix/additional-labels branch December 12, 2024 07:50
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.

4 participants