From d28815aac6c7a61426ab922015582a84512dc3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dulko?= Date: Fri, 30 Aug 2019 14:58:48 +0200 Subject: [PATCH] Remove runtime.LockOSThread() call from kuryr-cni runtime.LockOSThread() was a leftover from initial CNI plugin skeleton. It is only required when CNI plugin does the netns operations. Our plugin isn't doing that as it's kuryr-daemon that is responsible for that. Also the imports are now in nicer order. Change-Id: I1d7ee6a8fec104fd09094a49304a4c22b419cf3a --- kuryr_cni/main.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/kuryr_cni/main.go b/kuryr_cni/main.go index 7784c179a..0dd13a0b5 100644 --- a/kuryr_cni/main.go +++ b/kuryr_cni/main.go @@ -4,14 +4,13 @@ import ( "bytes" "encoding/json" "fmt" - "github.com/containernetworking/cni/pkg/types" "io/ioutil" "log" "net" "net/http" - "runtime" "github.com/containernetworking/cni/pkg/skel" + "github.com/containernetworking/cni/pkg/types" cni "github.com/containernetworking/cni/pkg/types" "github.com/containernetworking/cni/pkg/types/current" "github.com/containernetworking/cni/pkg/version" @@ -37,13 +36,6 @@ type KuryrDaemonData struct { KuryrConf interface{} `json:"config_kuryr"` } -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 transformData(args *skel.CmdArgs, command string) (KuryrDaemonData, error) { var conf interface{} err := json.Unmarshal(args.StdinData, &conf)