Skip to content

When windows layerFolder is null parsing of the runtime spec fails #126

Closed
@jsturtevant

Description

@jsturtevant

If windows layerFolders in null loading of the runtime spec fails. This happens when containerd serializes Windows{} portion of the spec due to go's serialization of lists

Example:

{
        "ociVersion": "1.0.2-dev",
        "process": {
            "user": {
                "username": "ContainerUser"
            },
            "args": [
                "/wasi-demo-app.wasm"
            ],
            "cwd": ""
        },
        "root": {
            "path": ""
        },
        "windows": {
            "layerFolders": null,
            "ignoreFlushesDuringBoot": true,
            "network": {
                "allowUnqualifiedDNSQuery": true
            }
        }
    }
let spec = Spec::load(path)?;
thread 'sandbox::oci::ocitests::test_oci_parse' panicked at 'called `Result::unwrap()` on an `Err` value: Oci(SerDe(Error("invalid type: null, expected a sequence", line: 16, column: 32)))', crates\containerd-shim-wasm\src\sandbox\oci.rs:221:49    

I was able to work around this by modifying containerd's ctr initialization to make a blank slice:

Windows: &specs.Windows{
			LayerFolders: []string{},
		},

which results in

"windows": {
            "layerFolders": [],
            "ignoreFlushesDuringBoot": true,
            "network": {
                "allowUnqualifiedDNSQuery": true
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions