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

@ -18,7 +18,6 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/containernetworking/cni/libcni"
)
@ -51,7 +50,7 @@ func main() {
netns := os.Args[3]
cninet := &libcni.CNIConfig{
Path: strings.Split(os.Getenv(EnvCNIPath), ":"),
Path: filepath.SplitList(os.Getenv(EnvCNIPath)),
}
rt := &libcni.RuntimeConf{