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

Do not set VCAP_APPLICATION env var during kpack staging #2258

Merged
merged 1 commit into from
May 5, 2021

Conversation

kieron-dev
Copy link
Contributor

  • A short explanation of the proposed change:

We have noticed that during kpack staging, VCAP_APPLICATION is set to a Hash#to_s string. It should be a json string, although in diego staging, VCAP_APPLICATION is not set at all.

This PR excludes VCAP_APPLICATION from the environment in the same way that VCAP_SERVICES is already excluded.

  • An explanation of the use cases your change solves

When deploying postfacto, for example, the rails-assets precompilation triggers bundle exec rails assets:precompile which ends up trying to deserialise VCAP_APPLICATION from json. This fails as it gets the ruby hash string. In CF on VMs, VCAP_APPLICATION is not set and the staging succeeds.

  • Links to any other associated PRs

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

VCAP_* vars are not set during diego staging. Restore this behaviour
regarding VCAP_APPLICATION for kpack staging.

At the moment, the contents of VCAP_APPLICATION are set to the output of
Hash#to_s, which is not valid JSON anyway.

Co-authored-by: Kieron Browne <[email protected]>
@acosta11
Copy link
Member

acosta11 commented May 5, 2021

LGTM, thanks for the PR!

Thanks,
Andrew and @jspawar

@jspawar jspawar merged commit 078a4f0 into cloudfoundry:main May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants