Skip to content

Enhance cni deletion #1149

@nevermore-muyi

Description

@nevermore-muyi

At https://github.com/containernetworking/cni/blob/main/libcni/api.go#L378, if cni has added network data into cni cache file path (default /var/lib/cni/results/xxx ), but the machine just restarted and the cni cache data may not saved because of disk synchronization.

So, if fdata is empty, may return nil is a more reasonable implementation?

fdata, err := os.ReadFile(fname) if err != nil { // Ignore read errors; the cached result may not exist on-disk return nil, nil } if fdata == "" { return nil, nil }

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