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

eck-beats/templates/beats.yaml adds spec.type: foo twice #7487

Closed
ke5C2Fin opened this issue Jan 18, 2024 · 1 comment · Fixed by #7523
Closed

eck-beats/templates/beats.yaml adds spec.type: foo twice #7487

ke5C2Fin opened this issue Jan 18, 2024 · 1 comment · Fixed by #7523
Assignees
Labels
>bug Something isn't working v2.12.0

Comments

@ke5C2Fin
Copy link

ke5C2Fin commented Jan 18, 2024

Bug Report

What did you do?

First I tried installing the chart, then used helm template to debug it.

helm template elastic/eck-beats -f values.yaml

What did you expect to see?
I expected the chart to install successfully.

What did you see instead? Under which circumstances?
Without .Values.spec.type defined

Error: execution error at (eck-beats/templates/beats.yaml:15:11): A Beat type is required

With .Values.spec.type defined

Helm install failed for release elastic-stack/elastic-stack-beats-infra with chart eck-beats@0.9.0: error while running post render on files: map[string]interface {}(nil): yaml: unmarshal errors: line 46: mapping key "type" already defined at line 17
spec:
  version: {{ required "A Beat version is required" .Values.version }}
  type: {{ required "A Beat type is required" .Values.spec.type }}
  {{- if and (not (hasKey .Values.spec "daemonSet")) (not (hasKey .Values.spec "deployment")) }}
  {{ fail "At least one of daemonSet or deployment is required for a functional Beat" }}
  {{- end }}
  {{- toYaml .Values.spec | nindent 2 }}

The template explicitly adds .spec.type from .Values.spec.type and then adds .Values.spec which includes .Values.spec.type again, resulting in a Beats CRD with .spec.type twice.

Environment

  • ECK version: 2.9, 2.10, 2.11
@botelastic botelastic bot added the triage label Jan 18, 2024
@thbkrkr thbkrkr added the >bug Something isn't working label Jan 24, 2024
@botelastic botelastic bot removed the triage label Jan 24, 2024
@naemono naemono self-assigned this Jan 29, 2024
@thbkrkr
Copy link
Contributor

thbkrkr commented Jan 29, 2024

Thanks for the report, there is indeed a bug in the Beats Helm chart that causes the type field to be duplicated.

> helm template elastic/eck-beats -f examples/filebeat_no_autodiscover.yaml | grep 'type: filebeat'
  type: filebeat
  type: filebeat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v2.12.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants