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

Creating a template from a missing file succeeds when it shouldn't #291

Closed
detiber opened this issue Sep 15, 2020 · 0 comments · Fixed by #293
Closed

Creating a template from a missing file succeeds when it shouldn't #291

detiber opened this issue Sep 15, 2020 · 0 comments · Fixed by #293
Assignees
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.

Comments

@detiber
Copy link
Contributor

detiber commented Sep 15, 2020

Expected Behaviour

If creating a template and providing a non-existant file using the -p argument, template creation should not succeed

Current 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:


Steps to Reproduce (for bugs)

  1. tink template create -n hello-world -p non-existant-file

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.

parauliya pushed a commit to infracloudio/tink that referenced this issue Sep 16, 2020
…lure

1. tink template create command should fail in case of any failures
2. tink template update command should fail in case of any failures

Signed-off-by: parauliya <[email protected]>
@parauliya parauliya self-assigned this Sep 16, 2020
@parauliya parauliya added priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. kind/bug Categorizes issue or PR as related to a bug. labels Sep 16, 2020
@mergify mergify bot closed this as completed in #293 Sep 16, 2020
mergify bot added a commit that referenced this issue Sep 16, 2020
…s not exist (#293)


Signed-off-by: parauliya <[email protected]>

## Description

1. tink template create command should fail in case of any failures
2. tink template update command should fail in case of any failures

## Why is this needed

Fixes: #291 

## How Has This Been Tested?
Tested manually using vagrant

## How are existing users impacted? What migration steps/scripts do we need?
No impact on existing users.

## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants