Skip to content

Commit 629766c

Browse files
feat(schema): add LocalVerifier.RunArgs for docker run passthrough
Adds an optional `runArgs []string` field to the `local` executionMode of customActions. The field is intended for docker run-style flags (`--network`, `-v`, `-e`, `--user`, `--add-host`, `--tmpfs`, `--privileged`, `--cap-add`, `--cap-drop`) that let users pass host paths, credentials, or networking configuration into action containers without forking Skaffold. The field itself is schema-only here; the whitelist parser and splicing into the docker API client arrive in a follow-up commit. A security note in the godoc warns that these flags bypass container isolation. Regenerates the v4beta15 JSON schema.
1 parent f34b6fc commit 629766c

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

docs-v2/content/en/schemas/v4beta15.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3442,6 +3442,15 @@
34423442
},
34433443
"LocalVerifier": {
34443444
"properties": {
3445+
"runArgs": {
3446+
"items": {
3447+
"type": "string"
3448+
},
3449+
"type": "array",
3450+
"description": "an optional list of `docker run` style flags to apply when launching the container, e.g. `--network=host`, `-v=/host:/container:ro`, `-e=FOO=bar`, `--user=1000:1000`. Only a small whitelist of flags is accepted (`--network`, `-v`/`--volume`, `-e`/`--env`, `--user`, `--add-host`, `--tmpfs`, `--privileged`, `--cap-add`, `--cap-drop`); unknown flags are rejected at load time. SECURITY NOTE: these flags bypass container isolation. `--privileged`, bind mounts of host secrets, and `--network=host` grant the container access to host resources. Only use values you trust, and prefer narrower alternatives (e.g. `--cap-add` over `--privileged`) when possible.",
3451+
"x-intellij-html-description": "an optional list of <code>docker run</code> style flags to apply when launching the container, e.g. <code>--network=host</code>, <code>-v=/host:/container:ro</code>, <code>-e=FOO=bar</code>, <code>--user=1000:1000</code>. Only a small whitelist of flags is accepted (<code>--network</code>, <code>-v</code>/<code>--volume</code>, <code>-e</code>/<code>--env</code>, <code>--user</code>, <code>--add-host</code>, <code>--tmpfs</code>, <code>--privileged</code>, <code>--cap-add</code>, <code>--cap-drop</code>); unknown flags are rejected at load time. SECURITY NOTE: these flags bypass container isolation. <code>--privileged</code>, bind mounts of host secrets, and <code>--network=host</code> grant the container access to host resources. Only use values you trust, and prefer narrower alternatives (e.g. <code>--cap-add</code> over <code>--privileged</code>) when possible.",
3452+
"default": "[]"
3453+
},
34453454
"useLocalImages": {
34463455
"type": "boolean",
34473456
"description": "if true, will first check if the containers images exist locally before triggering a pull. Defaults to false.",
@@ -3450,7 +3459,8 @@
34503459
}
34513460
},
34523461
"preferredOrder": [
3453-
"useLocalImages"
3462+
"useLocalImages",
3463+
"runArgs"
34543464
],
34553465
"additionalProperties": false,
34563466
"type": "object",

pkg/skaffold/schema/latest/config.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,20 @@ type LocalVerifier struct {
684684
// UseLocalImages if true, will first check if the containers images exist locally before triggering a pull.
685685
// Defaults to false.
686686
UseLocalImages bool `yaml:"useLocalImages,omitempty"`
687+
688+
// RunArgs is an optional list of `docker run` style flags to apply when
689+
// launching the container, e.g. `--network=host`, `-v=/host:/container:ro`,
690+
// `-e=FOO=bar`, `--user=1000:1000`. Only a small whitelist of flags is
691+
// accepted (`--network`, `-v`/`--volume`, `-e`/`--env`, `--user`,
692+
// `--add-host`, `--tmpfs`, `--privileged`, `--cap-add`, `--cap-drop`);
693+
// unknown flags are rejected at load time.
694+
//
695+
// SECURITY NOTE: these flags bypass container isolation. `--privileged`,
696+
// bind mounts of host secrets, and `--network=host` grant the container
697+
// access to host resources. Only use values you trust, and prefer
698+
// narrower alternatives (e.g. `--cap-add` over `--privileged`) when
699+
// possible.
700+
RunArgs []string `yaml:"runArgs,omitempty"`
687701
}
688702

689703
// KubernetesClusterVerifier uses the `kubectl` CLI to create veriy test case

0 commit comments

Comments
 (0)