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

Set VCAP_APPLICATION env var in apps #2187

Merged
merged 8 commits into from
Feb 15, 2023

Conversation

kieron-dev
Copy link
Contributor

Is there a related GitHub Issue?

#2140

What is this change about?

We now create VCAP_APPLICATION secret (similar to the existing VCAP_SERVICES) secret in the CFApp reconciler. This is set in the runworkload and taskworkloads so that apps and tasks have the env var set.

This triggered a set of changes:

  • We needed an e2e test to check running app env, so dora was introduced, and a helper function to curl a running CF app.
  • Since apps now report on their org and space via the VCAP_APPLICATION variable, it is not correct to create an app in any namespace - it must be a cf space namespace, so the controllers workloads tests have been modified to use actual CFSpaces.
  • A refactoring opportunity was taken to replace the many *List structs in the e2e suite with a single parameterised list struct.
  • Flakes were fixed in the env builder test by waiting for changes to propagate to the controller cache.

Does this PR introduce a breaking change?

No

Acceptance Steps

Push an app:

  1. See the VCAP_APPLICATION env var when curling the app env var endpoint
  2. See the VCAP_APPLICATION env var set in the running application

Tag your pair, your PM, and/or team

@georgethebeatle

Kieron Browne and others added 8 commits February 15, 2023 15:43
This creates a new secret for VCAP_APPLICATION env var in the CFApp
reconciler. Its contents are returned when getting the app env endpoint.

Issue: #2140
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
This introduces an e2e helper to curl pushed apps (curlApp), and vendirs
dora from cf-acceptances-tests into a zip so we can have an app that can
report its own env.

Issue: #2140
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
We can use a parameterised resourceList struct instead

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
Wait until the controller cache has picked up changes just made when
setting up the tests

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Apps now expect to be in spaces, so it is not sufficient to just create
a k8s namespace and put a CFApp in it - we now create a cf org in the
before suite, and create cf spaces in the tests.

Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
@kieron-dev kieron-dev force-pushed the issues/2140-vcap-application-envvar branch from e5e4826 to 93aa43f Compare February 15, 2023 16:12
@georgethebeatle georgethebeatle enabled auto-merge (rebase) February 15, 2023 16:13
@georgethebeatle georgethebeatle merged commit 272ca43 into main Feb 15, 2023
@georgethebeatle georgethebeatle deleted the issues/2140-vcap-application-envvar branch February 15, 2023 16:23
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.

3 participants