INNER CODE UNIT · Go

init

aws/amazon-vpc-cni-k8s · cmd/egress-cni-plugin/main.go:30

func init() {
	// this ensures that main runs only on main thread (thread group leader).
	// since namespace ops (unshare, setns) are done for a single thread, we
	// must ensure that the goroutine does not jump from OS thread to thread
	runtime.LockOSThread()
}

func main() {
	skel.PluginMain(cmdAdd, nil, cmdDel, cniversion.All, fmt.Sprintf("egress CNI plugin %s", version))
}

func cmdAdd(args *skel.CmdArgs) error {
	ec := NewEgressAddContext(args.Netns, args.IfName)
	return add(args, &ec)
}

func add(args *skel.CmdArgs, ec *egressContext) (err error) {
	ec.NetConf, ec.Log, err = LoadConf(args.StdinData)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…