Problem
Google Cloud Deploy passes deploy parameters to its execution environment as environment variables, surfacing them to render, custom action, and verify containers. Skaffold already accepts deploy parameters via --set / --set-value-file, but historically they were only used for manifest templating and only exposed on a subset of commands (render, filter, delete). As a result:
skaffold exec (custom actions) did not inject deploy parameters as environment variables into action containers.
skaffold verify did not accept --set / --set-value-file at all, and never injected deploy parameters into verify containers.
This breaks Cloud Deploy parity. A custom action (e.g. an Alembic database migration) cannot read a Cloud SQL connection URL passed as a deploy parameter, and a post-deploy verify smoke test cannot read the deployed Cloud Run service URL that Cloud Deploy injects automatically.
Expected behavior
--set / --set-value-file should be available on deploy, dev, run, exec, and verify (in addition to the existing render / filter / delete). On exec and verify, the supplied key/value pairs should additionally be injected as environment variables into every custom-action / verify container, with precedence (lowest → highest):
--env-file (base)
--set-value-file
--set
Current behavior
skaffold verify rejects --set / --set-value-file (flags are not registered on the command).
exec / verify containers receive no deploy parameters as environment variables.
Reproduction
Verify (Cloud Run service URL → Playwright smoke test):
# skaffold.yaml
apiVersion: skaffold/v4beta14
kind: Config
metadata:
name: repro
verify:
- name: smoke-test
container:
name: smoke
image: alpine:3.15.4
command: ["/bin/sh", "-c"]
args: ["echo \"smoke test against ${SERVICE_URL}\""]
$ skaffold verify --set SERVICE_URL=https://my-service-abc-uc.a.run.app
Error: unknown flag: --set # today
# expected: the container prints "smoke test against https://my-service-abc-uc.a.run.app"
Exec (Cloud SQL URL → Alembic migration):
# skaffold.yaml
apiVersion: skaffold/v4beta14
kind: Config
metadata:
name: repro
customActions:
- name: db-migrate
containers:
- name: alembic
image: alpine:3.15.4
command: ["/bin/sh", "-c"]
args: ["echo \"alembic upgrade head -> ${DATABASE_URL}\""]
$ skaffold exec db-migrate --set DATABASE_URL=postgresql+pg8000://user:pass@/app?unix_sock=/cloudsql/PROJECT:REGION:INSTANCE/.s.PGSQL.5432
# today: DATABASE_URL is empty inside the container
# expected: the container prints the full connection URL
Proposed solution / scope
- Expose
--set / --set-value-file on deploy, dev, run, exec, and verify.
- Inject the merged deploy parameters as environment variables into custom-action containers (
exec) and verify containers (verify), reusing one shared merge helper with the precedence above.
- Add runnable examples (custom-action Cloud SQL/Alembic migration; Playwright
verify smoke test) and document the behavior on the custom-actions and verify pages.
Problem
Google Cloud Deploy passes deploy parameters to its execution environment as environment variables, surfacing them to render, custom action, and verify containers. Skaffold already accepts deploy parameters via
--set/--set-value-file, but historically they were only used for manifest templating and only exposed on a subset of commands (render,filter,delete). As a result:skaffold exec(custom actions) did not inject deploy parameters as environment variables into action containers.skaffold verifydid not accept--set/--set-value-fileat all, and never injected deploy parameters into verify containers.This breaks Cloud Deploy parity. A custom action (e.g. an Alembic database migration) cannot read a Cloud SQL connection URL passed as a deploy parameter, and a post-deploy
verifysmoke test cannot read the deployed Cloud Run service URL that Cloud Deploy injects automatically.Expected behavior
--set/--set-value-fileshould be available ondeploy,dev,run,exec, andverify(in addition to the existingrender/filter/delete). Onexecandverify, the supplied key/value pairs should additionally be injected as environment variables into every custom-action / verify container, with precedence (lowest → highest):--env-file(base)--set-value-file--setCurrent behavior
skaffold verifyrejects--set/--set-value-file(flags are not registered on the command).exec/verifycontainers receive no deploy parameters as environment variables.Reproduction
Verify (Cloud Run service URL → Playwright smoke test):
Exec (Cloud SQL URL → Alembic migration):
Proposed solution / scope
--set/--set-value-fileondeploy,dev,run,exec, andverify.exec) and verify containers (verify), reusing one shared merge helper with the precedence above.verifysmoke test) and document the behavior on the custom-actions and verify pages.