diff options
| author | tv <tv@krebsco.de> | 2026-11-17 02:59:16 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-17 02:59:16 +0000 |
| commit | e0640333d0e9eb872a3abf68a9da1685ab570076 (patch) | |
| tree | 21a779ff77bfcea49a7cea148f9a81900bac3847 /pkgs | |
| parent | e0b8ef7a5f907baf7362ee34f24c107238590a8f (diff) | |
run-firecracker-vm: --egress defaults to the VM's name
A named VM uses the list of the same name unless given another with
--egress; without a name, still the list default. A missing list means
no egress (with a warning), as before; there's no fallback to default.
Diffstat (limited to 'pkgs')
| -rw-r--r-- | pkgs/run-firecracker-vm/default.nix | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/run-firecracker-vm/default.nix b/pkgs/run-firecracker-vm/default.nix index 223654a..f77520e 100644 --- a/pkgs/run-firecracker-vm/default.nix +++ b/pkgs/run-firecracker-vm/default.nix @@ -320,8 +320,8 @@ pkgs.writeShellScriptBin "run-firecracker-vm" /* sh */ '' # when the guest exits, or with --store, to FILE, which keeps it across # boots (created if it doesn't exist, of --store-size, default 16G; the # file is sparse, so that's only an upper limit). - # The guest's egress goes by the user's whitelist LIST (default: - # default), see modules/host and fc-egress. --name names the VM, for + # The guest's egress goes by the user's whitelist LIST (default: the + # VM's name, or without one, default), see modules/host and fc-egress. --name names the VM, for # fc-egress and as the guest's host name; only one running VM of the # user's can have a given name. set -efu @@ -333,7 +333,7 @@ pkgs.writeShellScriptBin "run-firecracker-vm" /* sh */ '' args= rw_store= rw_store_size=16G - egress=default + egress= name= nixpkgs=${lib.escapeShellArg (toString pkgs.path)} while test $# -gt 0; do @@ -349,6 +349,7 @@ pkgs.writeShellScriptBin "run-firecracker-vm" /* sh */ '' *) usage >&2; exit 1 esac done + egress=''${egress:-''${name:-default}} tmp=$(mktemp -d) trap 'rm -rf "$tmp"' EXIT |
