Reduce usage of `//go:embed` (`containerd.yaml`, `networks.TEMPLATE.yaml`, etc.)
- Dominant language
- Go
- Stars
- 21.9k
- Forks
- 957
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 53
Description
As in regular template YAMLs (`/usr/local/share/lima/templates/*.yaml`), `containerd.yaml`, `networks.TEMPLATE.yaml`, etc. could be read from the local directory rather than from `//go:embed`?
https://github.com/search?q=repo%3Alima-vm%2Flima+%22%2F%2Fgo%3Aembed%22&type=code
https://github.com/lima-vm/lima/blob/434aabef3f0aabc9bd21e14720906c15e756249d/pkg/limayaml/defaults.go#L61-L62
https://github.com/lima-vm/lima/blob/434aabef3f0aabc9bd21e14720906c15e756249d/pkg/networks/config.go#L23-L24
https://github.com/lima-vm/lima/blob/434aabef3f0aabc9bd21e14720906c15e756249d/pkg/cidata/template.go#L25-L31
https://github.com/lima-vm/lima/blob/434aabef3f0aabc9bd21e14720906c15e756249d/pkg/autostart/launchd/launchd.go#L19-L23
https://github.com/lima-vm/lima/blob/434aabef3f0aabc9bd21e14720906c15e756249d/pkg/autostart/systemd/systemd.go#L19-L20
## Driver-specific embeds (may stay embedded?)
https://github.com/lima-vm/lima/blob/434aabef3f0aabc9bd21e14720906c15e756249d/pkg/driver/wsl2/vm_windows.go#L72-L73
https://github.com/lima-vm/lima/blob/434aabef3f0aabc9bd21e14720906c15e756249d/pkg/driver/wsl2/wsl_driver_windows.go#L176-L177
https://github.com/lima-vm/lima/blob/434aabef3f0aabc9bd21e14720906c15e756249d/pkg/driver/vz/vz_driver_darwin.go#L231-L232
https://github.com/lima-vm/lima/blob/434aabef3f0aabc9bd21e14720906c15e756249d/pkg/driver/krunkit/krunkit_driver_darwin_arm64.go#L288-L289
## Guest agent embeds (should stay embedded probably, as the guest agent binary has been expected to be a single file)
https://github.com/lima-vm/lima/blob/434aabef3f0aabc9bd21e14720906c15e756249d/cmd/lima-guestagent/install_systemd_linux.go#L112-L113
Contributor guide
Research direction
Start with pkg/limayaml/defaults.go, pkg/networks/config.go, pkg/cidata/template.go, and the autostart launchd/systemd files, comparing their embeds with regular templates in /usr/local/share/lima/templates/*.yaml. Review the driver-specific and guest-agent embed locations to determine what remains embedded. Done means the eligible YAML and service templates are read locally without breaking their existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100