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

The secrets.yml check in the supply script uses different logic than the conjur-env binary to find the secrets.yml #82

Open
3 tasks
izgeri opened this issue Sep 17, 2020 · 0 comments

Comments

@izgeri
Copy link
Contributor

izgeri commented Sep 17, 2020

Summary

This was encountered by @whip113 when he had two secrets.yml files in the app in different directories AND specified SECRETS_YAML_PATH, but gave an invalid path.

Steps to Reproduce

Set up an app with at least one secrets.yml file and set SECRETS_YAML_PATH to an invalid path for the file.

Expected Results

The buildpack will fail fast and let me know at the supply stage that the secrets.yml isn't available at the path as expected.

Actual Results (including error logs, if applicable)

The supply stage completes successfully, since all it does is check if a secrets.yml file exists anywhere in the app (that is, it uses different logic than the conjur-env binary will use when it is run):

# Search for candidate `secrets.yml` paths and report them to the deploy output
secrets_yaml="$(find $BUILD_DIR -name 'secrets.yml' -printf \"%P\\n\")"
if [ -z "$secrets_yaml" ]; then
echo " - Unable to find a secrets.yml...exiting"
exit 1
else
echo " - secrets.yml file found at:"
echo $secrets_yaml
fi

But the buildpack errors when the conjur-env binary is run, because the file does not exist at the specified SECRETS_YAML_PATH:

secrets, err = secretsyml.ParseFromFile(secretsYamlPath, "", nil)

Reproducible

  • Always
  • Sometimes
  • Non-Reproducible

Version/Tag number

The latest version is impacted.

Environment setup

This is reproducible in TAS 2.9.

Additional Information

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants