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

Incorrect templating of Logstash object when using pipelinesRef parameter #8000

Closed
Fiki80 opened this issue Aug 12, 2024 · 2 comments · Fixed by #8087
Closed

Incorrect templating of Logstash object when using pipelinesRef parameter #8000

Fiki80 opened this issue Aug 12, 2024 · 2 comments · Fixed by #8087
Assignees
Labels
>bug Something isn't working v2.15.0

Comments

@Fiki80
Copy link

Fiki80 commented Aug 12, 2024

Bug Report

What did you do?
We wanted to define our pipeline via secret, so we have configured pipelinesRef in values:

eck-logstash:
    enabled: true
    pipelinesRef:
      secretName: logstash-pipelines-secret

What did you expect to see?
We expected helmchart to be deployed successfully and see the Logstash object containing only pipelinesRef parameter.

What did you see instead? Under which circumstances?
Templated Logstash object contains both pipelines and pipelinesRef parameters:

apiVersion: logstash.k8s.elastic.co/v1alpha1
kind: Logstash
metadata:
  name: release-name-eck-logstash
  labels:
    helm.sh/chart: eck-logstash-0.12.0
    app.kubernetes.io/name: eck-logstash
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/managed-by: Helm
  annotations:
    eck.k8s.elastic.co/license: basic
spec:
  version: 8.15.0
  count: 1
  pipelinesRef:
    secretName: logstash-pipelines-secret

  pipelines:
    []
  volumeClaimTemplates:
    - metadata:
        name: logstash-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 2Gi
        storageClassName: storage-del
  elasticsearchRefs:
    []

Helmchart cannot be deployed since validating webhook returns this error:

one or more synchronization tasks completed unsuccessfully, reason: admission webhook "elastic-logstash-validation-v1alpha1.k8s.elastic.co" denied the request: Logstash.logstash.k8s.elastic.co "ecn-monitoring-eck-logstash" is invalid: [spec.pipelines: Forbidden: Specify at most one of [`pipelines`, `pipelinesRef`], not both, spec.pipelinesRef: Forbidden: Specify at most one of [`pipelines`, `pipelinesRef`], not both] (retried 5 times).

Environment

  • ECK version:

    v2.14.0

@botelastic botelastic bot added the triage label Aug 12, 2024
@petkozma
Copy link

petkozma commented Aug 14, 2024

Possible suggestion:

  {{- if not (.Values.pipelinesRef)  }}
  pipelines: {{ toYaml .Values.pipelines | nindent 4 }}
  {{- end }}

@anroots-by
Copy link

Tested on a local fork, the suggested fix is working. Without it (current version of the chart), the .Values.pipelinesRef option is unusable.

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.15.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants