Skip to content

Commit

Permalink
Fix using the plugin without ports
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Luap99 committed Sep 3, 2021
1 parent 22fef7f commit 3c5837b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/meta/podman-machine/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3c5837b

Please sign in to comment.