File tree Expand file tree Collapse file tree 4 files changed +11
-9
lines changed Expand file tree Collapse file tree 4 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ func main() {
6868 useCdi := false
6969 flag .BoolVar (& useCdi , "use-cdi" , false ,
7070 "Use Container Device Interface to expose devices in containers" )
71+ pluginMode := false
72+ flag .BoolVar (& pluginMode , "plugin-mode" , true ,
73+ "Using Kubelet Plugin Registry Mode if true, else to using Deprecated Device Plugin Registry Path " )
7174 flag .Parse ()
7275 if versionOpt {
7376 fmt .Printf ("%s\n " , printVersionString ())
@@ -80,7 +83,7 @@ func main() {
8083
8184 log .Println ("Starting K8s RDMA Shared Device Plugin version=" , version )
8285
83- rm := resources .NewResourceManager (configFilePath , useCdi )
86+ rm := resources .NewResourceManager (configFilePath , useCdi , pluginMode )
8487
8588 log .Println ("resource manager reading configs" )
8689 if err := rm .ReadConfig (); err != nil {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ require (
1010 github.com/onsi/ginkgo v1.16.5
1111 github.com/onsi/gomega v1.38.0
1212 github.com/pkg/errors v0.9.1
13- github.com/stretchr/testify v1.10 .0
13+ github.com/stretchr/testify v1.11 .0
1414 github.com/vishvananda/netlink v1.3.1
1515 golang.org/x/net v0.43.0
1616 google.golang.org/grpc v1.74.2
Original file line number Diff line number Diff line change @@ -103,8 +103,8 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/
103103github.com/stretchr/testify v1.2.2 /go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs =
104104github.com/stretchr/testify v1.3.0 /go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI =
105105github.com/stretchr/testify v1.5.1 /go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA =
106- github.com/stretchr/testify v1.10 .0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA =
107- github.com/stretchr/testify v1.10 .0 /go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY =
106+ github.com/stretchr/testify v1.11 .0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8 =
107+ github.com/stretchr/testify v1.11 .0 /go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U =
108108github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI =
109109github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 /go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww =
110110github.com/urfave/cli v1.19.1 /go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA =
Original file line number Diff line number Diff line change @@ -90,18 +90,17 @@ type resourceManager struct {
9090 useCdi bool
9191}
9292
93- func NewResourceManager (configFile string , useCdi bool ) types.ResourceManager {
94- watcherMode := detectPluginWatchMode (activeSockDir )
95- if watcherMode {
93+ func NewResourceManager (configFile string , useCdi , pluginMode bool ) types.ResourceManager {
94+ if pluginMode {
9695 fmt .Println ("Using Kubelet Plugin Registry Mode" )
9796 } else {
98- fmt .Println ("Using Deprecated Devie Plugin Registry Path" )
97+ fmt .Println ("Using Deprecated Device Plugin Registry Path" )
9998 }
10099 return & resourceManager {
101100 configFile : configFile ,
102101 defaultResourcePrefix : rdmaHcaResourcePrefix ,
103102 socketSuffix : socketSuffix ,
104- watchMode : watcherMode ,
103+ watchMode : pluginMode ,
105104 netlinkManager : & netlinkManager {},
106105 rds : NewRdmaDeviceSpec (requiredRdmaDevices ),
107106 useCdi : useCdi ,
You can’t perform that action at this time.
0 commit comments