Skip to content

Commit

Permalink
Merge pull request #70 from space88man/parse_cni_args
Browse files Browse the repository at this point in the history
Propagate existing CNI_ARGS to non-k8s consumers, e.g., podman
  • Loading branch information
openshift-merge-robot authored Mar 3, 2021
2 parents 541cf7c + c0cef6a commit 87390b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/ocicni/ocicni.go
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,13 @@ func buildCNIRuntimeConf(podNetwork *PodNetwork, ifName string, runtimeConfig Ru
CapabilityArgs: map[string]interface{}{},
}

// Propagate existing CNI_ARGS to non-k8s consumers
for _, kvpairs := range strings.Split(os.Getenv("CNI_ARGS"), ";"){
if keyval := strings.SplitN(kvpairs, "=", 2); len(keyval) == 2 {
rt.Args = append(rt.Args, [2]string{keyval[0], keyval[1]})
}
}

// Add requested static IP to CNI_ARGS
ip := runtimeConfig.IP
if ip != "" {
Expand Down

0 comments on commit 87390b5

Please sign in to comment.