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

EOF if document contains --- in the middle of a condition block since 1.8.0 #117

Open
GJKrupa opened this issue Sep 18, 2018 · 2 comments
Open

Comments

@GJKrupa
Copy link
Contributor

GJKrupa commented Sep 18, 2018

For example:

apiVersion: v1
kind: ConfigMap
metadata:
  name: my-map
data:
    my.value: 1
{{if eq .KUBE_NAMESPACE "my-prod"}}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-map-2
data:
    my.value: 2
{{end}}

We see the following error:

[ERROR] 2018/09/18 17:56:52 render.go:33: template: template:8: unexpected EOF

The last working version with these templates I can find is v0.13.0

@PhilOfCalth
Copy link

PhilOfCalth commented Aug 22, 2019

I get a similar problem if there is a --- inside a range

{{ range list 1 2 3 -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: zookeeper{{ . }}
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: zookeeper
    spec:
      terminationGracePeriodSeconds: 30
      containers:
      - name: zookeeper
        image: bitnami/zookeeper:3.5.5
# .   ...
---
{{ end }}

@PhilOfCalth
Copy link

PhilOfCalth commented Aug 22, 2019

It can be gotten around by using a variable to replace the ---
EG

{{ $end := "---" }}
{{ range list 1 2 3 -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: zookeeper{{ . }}
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: zookeeper
    spec:
      terminationGracePeriodSeconds: 30
      containers:
      - name: zookeeper
        image: bitnami/zookeeper:3.5.5
# .   ...
{{ $end }}
{{ end }} 

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

No branches or pull requests

2 participants