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

Parsing error on Helm Chart YAML files #3300

Closed
nils-werner-sonarsource opened this issue Aug 4, 2022 · 1 comment · Fixed by #3310 or #4610
Closed

Parsing error on Helm Chart YAML files #3300

nils-werner-sonarsource opened this issue Aug 4, 2022 · 1 comment · Fixed by #3310 or #4610
Assignees
Milestone

Comments

@nils-werner-sonarsource
Copy link

Since SonarJs parses Yaml files to analyze possible JavaScript code inside, parser errors occur in YAML files containing Helm chart template directives. These directives do not follow the YAML standard.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "hello-world.fullname" . }}
  labels:
    {{- include "hello-world.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      {{- include "hello-world.selectorLabels" . | nindent 6 }}
...

Since these files do not contain valid JavaScript code, they should not be parsed and should be excluded from parsing by preprocessing. (See also SONARIAC-435)

@saberduck
Copy link
Contributor

I am reopening this ticket, because the new predicate is not used in the sensor, which should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment