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.
@@ -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)
