containers / krunvm

Create microVMs from OCI images
Apache License 2.0
1.41k stars 42 forks source link

krunvm accepts to create a VM with an empty name #63

Closed Tilatti closed 3 months ago

Tilatti commented 3 months ago

I managed to create a new VM with an empty name.

$ krunvm create --name "" debian
microVM created with name:

It seems to store a broken configuration, which cannot be parsed by confyanymore.

$ krunvm list
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: BadTomlData(Error { inner: ErrorInner { kind: Wanted { expected: "a table key", found: "a right bracket" }, line: Some(5), col: 14, at: Some(121), message: "", key: [] } })', src/main.rs:170:55
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The TOML file configuration is the following:

$ cat Library/Preferences/rs.krunvm/krunvm.toml
version = 1
default_cpus = 2
default_mem = 1024
default_dns = '1.1.1.1'
storage_volume = '/Volumes/krunvm'
[vmconfig_map.]
name = ''
cpus = 2
mem = 1024
container = 'debian-working-container-1'
workdir = ''
dns = '1.1.1.1'

[vmconfig_map..mapped_volumes]

[vmconfig_map..mapped_ports]

I can reproduce the problem on both v0.2.3 and on the HEAD of master (revision: 5494d84a66bee3b802a0392cf8d662158ac7287d). I only tried on macOS.