From 3c5837b23576bbe06c7171ef8481c0004fdcc92f Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 3 Sep 2021 15:07:49 +0200 Subject: [PATCH] Fix using the plugin without ports When no ports are set we still have to return the CNI result back. Otherwise CNI will fail with `unexpected end of JSON input`. Fixes containers/podman#11413 Signed-off-by: Paul Holzinger --- plugins/meta/podman-machine/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/meta/podman-machine/main.go b/plugins/meta/podman-machine/main.go index 893e6ec..01a3a9f 100644 --- a/plugins/meta/podman-machine/main.go +++ b/plugins/meta/podman-machine/main.go @@ -43,7 +43,8 @@ func cmdAdd(args *skel.CmdArgs) error { } // No portmappings, do nothing if len(portMaps.RuntimeConfig.PortMaps) < 1 { - return nil + // Have to do this for chained plugins, which this is + return types.PrintResult(portMaps.PrevResult, portMaps.CNIVersion) } // Iterate and send requests to the server for _, pm := range portMaps.RuntimeConfig.PortMaps {