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

Resource with 'parameters' key and no syntax "cannot unmarshal !!map into []engine.TemplateKindTemplateParameter" #33

Open
krbcmt opened this issue Jul 30, 2020 · 0 comments

Comments

@krbcmt
Copy link

krbcmt commented Jul 30, 2020

Issue type: Bug

Given a kubernetes resource file that has a top-level key parameters and no syntax definition as a comment nor command-line argument a fatal unmarshal error occurs.

Example resource.yml:

---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
   name: rook-ceph-delete-bucket
provisioner: ceph.rook.io/bucket
reclaimPolicy: Delete
parameters:
  objectStoreName: ceph-object-store
  objectStoreNamespace: rook-ceph
$ kubetpl render resource.yml
yaml: unmarshal errors:
  line 8: cannot unmarshal !!map into []engine.TemplateKindTemplateParameter

According to the documentation, in the absence of a syntax declaration:

kubetpl assumes that template is a regular resource definition file

But it seems that it's maybe actually trying to render it as template-kind?

A workaround is to add # kubetpl:syntax:$ and, in this case, it renders as expected.

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