spec, libcni, pkg/invoke: Use OS-agnostic separator when parsing CNI_PATH

Hardcoding the list separator character as ":" causes CNI to fail when parsing
CNI_PATH on other operating systems. For example, Windows uses ";" as list
separator because ":" can legally appear in paths such as "C:\path\to\file".
This change replaces use of ":" with OS-agnostic APIs or os.PathListSeparator.

Fixes #358
This commit is contained in:
Onur
2017-01-28 13:30:00 -08:00
committed by Onur Filiz
parent c4271dba67
commit 0d9a1d70f8
4 changed files with 7 additions and 7 deletions

View File

@ -15,6 +15,7 @@
package libcni
import (
"os"
"strings"
"github.com/containernetworking/cni/pkg/invoke"
@ -165,6 +166,6 @@ func (c *CNIConfig) args(action string, rt *RuntimeConf) *invoke.Args {
NetNS: rt.NetNS,
PluginArgs: rt.Args,
IfName: rt.IfName,
Path: strings.Join(c.Path, ":"),
Path: strings.Join(c.Path, string(os.PathListSeparator)),
}
}