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

Support --var in cf push #3384

Closed
danail-branekov opened this issue Jul 16, 2024 · 1 comment
Closed

Support --var in cf push #3384

danail-branekov opened this issue Jul 16, 2024 · 1 comment

Comments

@danail-branekov
Copy link
Member

danail-branekov commented Jul 16, 2024

Acceptance

Acceptance

GIVEN I have pushed an app via cf push --var FOO=var, e.g.
cf push dorifi --var FOO=bar -p ~/workspace/korifi/tests/assets/dorifi

WHEN The app has started

THEN I can see the FOO env var set to bar in the application environment, e.g.
curl -k https://dorifi.apps-127-0-0-1.nip.io/env.json | jq .FOO should return bar

Dev notes

That environment variable should be made available into the <app-guid>-env secret.

FWIW, pushing the app via a manifest with env, e.g.

---
applications:
- name: dorifi
  path: /home/ccloud/workspace/korifi/tests/assets/dorifi
  env:
    FOO: bar

works as expected, i.e. the env secret contains a FOO entry and the application gets the FOO env var

@danail-branekov
Copy link
Member Author

Sounds like a misunderstanding.

According to the docs and cli help

--var                        Variable key value pair for variable substitution, (e.g., name=app1); can specify multiple times
--vars-file                  Path to a variable substitution file for manifest; can specify multiple times

it sounds like --var is used to configure manifest variables (e.g. ((instances))) rather than setting whatever env vars. It seems the only way to configure custom env vars for an app during push is to use a manifest

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

No branches or pull requests

1 participant