aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/containernetworking/cni/pkg/invoke
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2022-07-28 23:27:42 +0200
committerMiloslav Trmač <mitr@redhat.com>2022-08-02 16:52:56 +0200
commiteacee60c83685c9e6796b96b22f51625f8012530 (patch)
tree1f9c202f77addfebdf4e004795c9c33ff3ebd008 /vendor/github.com/containernetworking/cni/pkg/invoke
parent62cc871c6667268fca30708fd03f25ee66a6fc99 (diff)
downloadpodman-eacee60c83685c9e6796b96b22f51625f8012530.tar.gz
podman-eacee60c83685c9e6796b96b22f51625f8012530.tar.bz2
podman-eacee60c83685c9e6796b96b22f51625f8012530.zip
Update c/common to an unreleased version
... to get https://github.com/containers/common/pull/1106 . Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'vendor/github.com/containernetworking/cni/pkg/invoke')
-rw-r--r--vendor/github.com/containernetworking/cni/pkg/invoke/exec.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/vendor/github.com/containernetworking/cni/pkg/invoke/exec.go b/vendor/github.com/containernetworking/cni/pkg/invoke/exec.go
index 55ed392a0..3ad07aa8f 100644
--- a/vendor/github.com/containernetworking/cni/pkg/invoke/exec.go
+++ b/vendor/github.com/containernetworking/cni/pkg/invoke/exec.go
@@ -50,6 +50,12 @@ func fixupResultVersion(netconf, result []byte) (string, []byte, error) {
return "", nil, fmt.Errorf("failed to unmarshal raw result: %w", err)
}
+ // plugin output of "null" is successfully unmarshalled, but results in a nil
+ // map which causes a panic when the confVersion is assigned below.
+ if rawResult == nil {
+ rawResult = make(map[string]interface{})
+ }
+
// Manually decode Result version; we need to know whether its cniVersion
// is empty, while built-in decoders (correctly) substitute 0.1.0 for an
// empty version per the CNI spec.