de-jcup / eclipse-yaml-editor

Eclipse YAML editor
https://marketplace.eclipse.org/content/yaml-editor
Apache License 2.0
34 stars 10 forks source link

Full line go template gives an error #79

Closed bentatham closed 4 years ago

bentatham commented 4 years ago

First off - amazing that you added support for Go Templates for Helm in #76 .

If I have a template where the entire file is in a conditional like this:

{{ if and .Values.apollo (eq .Values.apollo "true") }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: apollo
  labels:
    app: apollo
spec:
 ...
{{ end }}

I get an error from the yaml editor:

mapping values are not allowed here
 in 'reader', line 2, column 11:
    apiVersion: apps/v1
              ^

Not sure if it works in all cases, but maybe try to treat all lines that start with {{ as comments? Or some other hack of the yaml like that?

de-jcup commented 4 years ago

Yes you are right: image

To handle those parts as comment should be right choice. Will come with next release.

Thanx for reporting.

de-jcup commented 4 years ago

Now correct handled: image

image

de-jcup commented 4 years ago

@bentatham just released 1.6.1 on eclipse marketplace containing the bugfix