cloudfoundry/credhub-cli

environment variables should be ignored if empty string

jtarchie opened this issue · 2 comments

What version of the credhub server you are using?

it is reporting 0.0.0 from the CLI

What version of the credhub cli you are using?

2.1.0

If you were attempting to accomplish a task, what was it you were attempting to do?

Creating a concourse task that sets the CREDHUB-* environment variables to allow people to run credhub interpolate. We've specified them under params in out tasks, as empty/null values, which allows pipelines to override them.

What did you expect to happen?

CREDHUB_CA_CERT would be ignored if it was an empty string.

What was the actual behavior?

$ export CREDHUB_SERVER="https://example.com" CREDHUB_SECRET="secret" CREDHUB_CLIENT="concourse" CREDHUB_CA_CERT=""
$ credhub interpolate --prefix /pipeline/vsphere --file 'files/*.yml'
provided ca certs are invalid

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

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

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

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

@jtarchie The CredHub team discussed this and we believe that throwing an error when an environment variable is present but not set follows expected behavior. Therefore, we would like to maintain the current behavior in order to be consistent with other CLI's.