Bug Description
The --ssh-key-file CLI flag is registered (cmd/virtwork/main.go:90) but never consumed by resolveSSHKeys() in internal/config/config.go. Users who pass --ssh-key-file ~/.ssh/id_ed25519.pub get zero SSH keys injected into VMs. The flag is silently ignored with no error or warning.
resolveSSHKeys() only handles three sources:
--ssh-key (inline public key strings)
VIRTWORK_SSH_AUTHORIZED_KEYS env var (comma-split)
ssh-authorized-keys YAML config list
It never reads --ssh-key-file, loads file contents from disk, or merges them into cfg.SSHAuthorizedKeys.
Steps to Reproduce
- Generate an SSH key:
ssh-keygen -t ed25519 -f ~/.ssh/virtwork_ed25519 -N ""
- Run:
virtwork run --workloads cpu --ssh-user virtwork --ssh-key-file ~/.ssh/virtwork_ed25519.pub --dry-run
- Inspect the generated cloud-init config — no SSH authorized keys are present
- Alternatively, deploy without
--dry-run and attempt virtctl ssh — access is denied
Expected Behavior
--ssh-key-file should read the public key file(s) from disk and merge their contents into the SSHAuthorizedKeys list, so the keys are injected into VM cloud-init configs and SSH access works.
Actual Behavior
The flag is accepted without error but completely ignored. No SSH keys are injected. No warning is emitted. Users have no SSH access to VMs when relying solely on this flag.
The Phase 10 engineering journal explicitly acknowledges this was deferred: "flag exists for future use; --ssh-key (inline) works now" — but the README, configuration.md, development.md, chaos-workloads.md, the user guide, and the presentation demo script all document --ssh-key-file as the primary SSH workflow.
Affected documentation showing broken examples
README.md:92 — virtwork run --ssh-key-file ~/.ssh/id_ed25519.pub
docs/configuration.md:56-59
docs/development.md:31,659,679,745,750
docs/chaos-workloads.md:90,141,208
docs/guide/02-deploying-workloads.md:242,452,481
docs/plans/presentation/outline.md:88
Additional Context
The test at cmd/virtwork/main_test.go:243 only verifies the flag is parseable by Cobra, not that file contents are read or merged into config. A functional test that asserts file-based keys appear in cfg.SSHAuthorizedKeys is needed.
Bug Description
The
--ssh-key-fileCLI flag is registered (cmd/virtwork/main.go:90) but never consumed byresolveSSHKeys()ininternal/config/config.go. Users who pass--ssh-key-file ~/.ssh/id_ed25519.pubget zero SSH keys injected into VMs. The flag is silently ignored with no error or warning.resolveSSHKeys()only handles three sources:--ssh-key(inline public key strings)VIRTWORK_SSH_AUTHORIZED_KEYSenv var (comma-split)ssh-authorized-keysYAML config listIt never reads
--ssh-key-file, loads file contents from disk, or merges them intocfg.SSHAuthorizedKeys.Steps to Reproduce
ssh-keygen -t ed25519 -f ~/.ssh/virtwork_ed25519 -N ""virtwork run --workloads cpu --ssh-user virtwork --ssh-key-file ~/.ssh/virtwork_ed25519.pub --dry-run--dry-runand attemptvirtctl ssh— access is deniedExpected Behavior
--ssh-key-fileshould read the public key file(s) from disk and merge their contents into theSSHAuthorizedKeyslist, so the keys are injected into VM cloud-init configs and SSH access works.Actual Behavior
The flag is accepted without error but completely ignored. No SSH keys are injected. No warning is emitted. Users have no SSH access to VMs when relying solely on this flag.
The Phase 10 engineering journal explicitly acknowledges this was deferred: "flag exists for future use;
--ssh-key(inline) works now" — but the README, configuration.md, development.md, chaos-workloads.md, the user guide, and the presentation demo script all document--ssh-key-fileas the primary SSH workflow.Affected documentation showing broken examples
README.md:92—virtwork run --ssh-key-file ~/.ssh/id_ed25519.pubdocs/configuration.md:56-59docs/development.md:31,659,679,745,750docs/chaos-workloads.md:90,141,208docs/guide/02-deploying-workloads.md:242,452,481docs/plans/presentation/outline.md:88Additional Context
The test at
cmd/virtwork/main_test.go:243only verifies the flag is parseable by Cobra, not that file contents are read or merged into config. A functional test that asserts file-based keys appear incfg.SSHAuthorizedKeysis needed.