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 template/translate literal values in environment variable output #3002

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

Samze
Copy link
Contributor

@Samze Samze commented Jul 8, 2024

Description of the Change

Do not attempt to template/translate text when outputting environment variables returned by CF. Print them as literals.

Fixes #2821

Example with this change - note the user provided service:

 ./out/cf env icu2
Getting env variables for app icu2 in org org-1 / space space-1 as admin...
System-Provided:
VCAP_SERVICES: {}


VCAP_APPLICATION: {
  "application_id": "d8c053f9-4092-4579-a17a-b5509427e02b",
  "application_name": "icu2",
  "application_uris": [
    "icu2.apps.axle-2021601.cf-app.com"
  ],
  "cf_api": "https://api.sys.axle-2021601.cf-app.com",
  "limits": {
    "fds": 16384
  },
  "name": "icu2",
  "organization_id": "10112d35-539f-44b1-9051-cc6b1f2abddb",
  "organization_name": "org-1",
  "space_id": "6fcc249a-e62e-4000-9fec-6dfeb267b5a1",
  "space_name": "space-1",
  "uris": [
    "icu2.apps.axle-2021601.cf-app.com"
  ],
  "users": null
}


User-Provided:
TEST2: blah{{
TEST4: blah

No running env variables have been set

No staging env variables have been set

Why Is This PR Valuable?

Any env var (e.g. user provided, service binding) that contains go templating character will cause issues, e.g. `{{ }}``.


Note: will port to v7/main once tests are green and this is approved.

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

Successfully merging this pull request may close these issues.

3 participants