cloudfoundry / credhub-cli

CredHub CLI provides a command line interface to interact with CredHub servers
Apache License 2.0
39 stars 44 forks source link

interpolate is inconsistent with how it treats empty/valid files #75

Closed kcboyle closed 5 years ago

kcboyle commented 5 years ago

What version of the credhub server you are using? unknown. Using credhub from concourse 5.1

What version of the credhub cli you are using? 2.4.0

If you were attempting to accomplish a task, what was it you were attempting to do? We were attempting to interpolate an empty file, but got an error. When running another test with invalid yaml in that file, we did not get an error.

What did you expect to happen? I expected a consistent experience for credhub interpolate when using an empty file or invalid file

What was the actual behavior? One returned an error, the other did not

Please confirm where necessary:

if you had an empty file, credhub interpolate fails. However, if you gave that same file minimal yaml (---) with nothing else in it, it would pass. If you also give it a file with - or invalid: as the only file contents, this also does not return an error.

→ credhub interpolate --file minimal-yaml.yml
null

→ echo $?
0

→ credhub interpolate --file invalid-yaml.yml
null

→ echo $?
0

→ credhub interpolate --file empty-yaml.yml
Error: empty-yaml.yml was an empty file

→ echo $?
1
cf-gitbot commented 5 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/166067912

The labels on this github issue will be updated when the story is started.

ankeesler commented 5 years ago

Fixed in https://github.com/cloudfoundry-incubator/credhub-cli/releases/tag/2.5.0. Thanks!