Creating a template from a missing file succeeds when it shouldn't #291
Labels
kind/bug
Categorizes issue or PR as related to a bug.
priority/critical-urgent
Highest priority. Must be actively worked on as someone's top priority right now.
Expected Behaviour
If creating a template and providing a non-existant file using the
-p
argument, template creation should not succeedCurrent Behaviour
Template creation succeeds despite the error:
# tink template create -n hello-world -p hello-world.yaml 2020/09/15 14:50:01 open hello-world.yaml: no such file or directory 2020/09/15 14:50:01 invalid argument Created Template: bbe693a4-f762-11ea-aefe-aac6213d5309
Possible Solution
Do not eat errors when opening/reading from non-existent file:
tink/cmd/tink-cli/cmd/template/create.go
Line 46 in ca0df06
tink/cmd/tink-cli/cmd/template/create.go
Line 65 in ca0df06
Steps to Reproduce (for bugs)
Context
I accidentally tried to create a template using the wrong filename and because it did not result in an error and the template was created I did not notice until trying to figure out why until I tried to run
tink template get <id>
to see the template output and realized it was empty because I specified the wrong file name.The text was updated successfully, but these errors were encountered: