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
This commit is contained in:
parent
ff7b449529
commit
d28815aac6
|
@ -4,14 +4,13 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/containernetworking/cni/pkg/types"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"runtime"
|
|
||||||
|
|
||||||
"github.com/containernetworking/cni/pkg/skel"
|
"github.com/containernetworking/cni/pkg/skel"
|
||||||
|
"github.com/containernetworking/cni/pkg/types"
|
||||||
cni "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/types/current"
|
||||||
"github.com/containernetworking/cni/pkg/version"
|
"github.com/containernetworking/cni/pkg/version"
|
||||||
|
@ -37,13 +36,6 @@ type KuryrDaemonData struct {
|
||||||
KuryrConf interface{} `json:"config_kuryr"`
|
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) {
|
func transformData(args *skel.CmdArgs, command string) (KuryrDaemonData, error) {
|
||||||
var conf interface{}
|
var conf interface{}
|
||||||
err := json.Unmarshal(args.StdinData, &conf)
|
err := json.Unmarshal(args.StdinData, &conf)
|
||||||
|
|
Loading…
Reference in New Issue