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

BUG: --freeze says 'Malformed object (missing/invalid kind)' with valid yaml and kubernetes resource #36

Open
krbcmt opened this issue Sep 17, 2021 · 0 comments

Comments

@krbcmt
Copy link

krbcmt commented Sep 17, 2021

--freeze can't handle yaml files that start with yaml's ---, the c-document-start boundary marker. Without --freeze render handles the yaml with or without the boundary marker.

❯ cat configmap.template
# kubetpl:syntax:go-template
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .APP }}-config
  namespace: {{ .NAMESPACE }}
data:
  my-key: my-value

❯ ./kubetpl-0.9.0-linux-amd64 render configmap.template --freeze --set APP=my-app --set NAMESPACE=default
---
apiVersion: v1
data:
  my-key: my-value
kind: ConfigMap
metadata:
  name: my-app-config-3b45d2a
  namespace: default

❯ vi configmap.template #Add --- to the top of the yaml block

❯ cat configmap.template
# kubetpl:syntax:go-template
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .APP }}-config
  namespace: {{ .NAMESPACE }}
data:
  my-key: my-value

❯ ./kubetpl-0.9.0-linux-amd64 render configmap.template --freeze --set APP=my-app --set NAMESPACE=default
Malformed object (missing/invalid kind)

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

1 participant