Merge pull request #663 from abhi/cni

Moving to use go-cni library from containerd
This commit is contained in:
Lantao Liu
2018-03-15 17:53:50 -07:00
committed by GitHub
34 changed files with 985 additions and 2541 deletions

View File

@@ -109,6 +109,14 @@ const (
containerMetadataExtension = criContainerdPrefix + ".container.metadata"
)
const (
// defaultIfName is the default network interface for the pods
defaultIfName = "eth0"
// networkAttachCount is the minimum number of networks the PodSandbox
// attaches to
networkAttachCount = 2
)
// makeSandboxName generates sandbox name from sandbox metadata. The name
// generated is unique as long as sandbox metadata is unique.
func makeSandboxName(s *runtime.PodSandboxMetadata) string {
@@ -423,3 +431,12 @@ func disableNetNSDAD(ns string) error {
}
return nil
}
func getPodCNILabels(id string, config *runtime.PodSandboxConfig) map[string]string {
return map[string]string{
"K8S_POD_NAMESPACE": config.GetMetadata().GetNamespace(),
"K8S_POD_NAME": config.GetMetadata().GetName(),
"K8S_POD_INFRA_CONTAINER_ID": id,
"IgnoreUnknown": "1",
}
}