Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
e5667cf4
Commit
e5667cf4
authored
Dec 05, 2017
by
Connor Doyle
Committed by
Connor Doyle
Jan 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename package deviceplugin => devicemanager.
parent
0a20e101
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
53 additions
and
59 deletions
+53
-59
BUILD
pkg/kubelet/cm/BUILD
+2
-2
container_manager_linux.go
pkg/kubelet/cm/container_manager_linux.go
+9
-9
BUILD
pkg/kubelet/cm/devicemanager/BUILD
+18
-22
OWNERS
pkg/kubelet/cm/devicemanager/OWNERS
+0
-0
device_plugin_stub.go
pkg/kubelet/cm/devicemanager/device_plugin_stub.go
+1
-1
endpoint.go
pkg/kubelet/cm/devicemanager/endpoint.go
+1
-1
endpoint_test.go
pkg/kubelet/cm/devicemanager/endpoint_test.go
+1
-1
manager.go
pkg/kubelet/cm/devicemanager/manager.go
+10
-10
manager_stub.go
pkg/kubelet/cm/devicemanager/manager_stub.go
+1
-1
manager_test.go
pkg/kubelet/cm/devicemanager/manager_test.go
+1
-1
pod_devices.go
pkg/kubelet/cm/devicemanager/pod_devices.go
+1
-1
types.go
pkg/kubelet/cm/devicemanager/types.go
+1
-1
BUILD
test/e2e_node/BUILD
+4
-6
device_plugin.go
test/e2e_node/device_plugin.go
+3
-3
No files found.
pkg/kubelet/cm/BUILD
View file @
e5667cf4
...
@@ -123,7 +123,7 @@ go_library(
...
@@ -123,7 +123,7 @@ go_library(
"//pkg/apis/core/v1/helper:go_default_library",
"//pkg/apis/core/v1/helper:go_default_library",
"//pkg/apis/core/v1/helper/qos:go_default_library",
"//pkg/apis/core/v1/helper/qos:go_default_library",
"//pkg/kubelet/cadvisor:go_default_library",
"//pkg/kubelet/cadvisor:go_default_library",
"//pkg/kubelet/cm/device
plugin
:go_default_library",
"//pkg/kubelet/cm/device
manager
:go_default_library",
"//pkg/kubelet/cm/util:go_default_library",
"//pkg/kubelet/cm/util:go_default_library",
"//pkg/kubelet/events:go_default_library",
"//pkg/kubelet/events:go_default_library",
"//pkg/kubelet/metrics:go_default_library",
"//pkg/kubelet/metrics:go_default_library",
...
@@ -219,7 +219,7 @@ filegroup(
...
@@ -219,7 +219,7 @@ filegroup(
":package-srcs",
":package-srcs",
"//pkg/kubelet/cm/cpumanager:all-srcs",
"//pkg/kubelet/cm/cpumanager:all-srcs",
"//pkg/kubelet/cm/cpuset:all-srcs",
"//pkg/kubelet/cm/cpuset:all-srcs",
"//pkg/kubelet/cm/device
plugin
:all-srcs",
"//pkg/kubelet/cm/device
manager
:all-srcs",
"//pkg/kubelet/cm/util:all-srcs",
"//pkg/kubelet/cm/util:all-srcs",
],
],
tags = ["automanaged"],
tags = ["automanaged"],
...
...
pkg/kubelet/cm/container_manager_linux.go
View file @
e5667cf4
...
@@ -45,7 +45,7 @@ import (
...
@@ -45,7 +45,7 @@ import (
internalapi
"k8s.io/kubernetes/pkg/kubelet/apis/cri"
internalapi
"k8s.io/kubernetes/pkg/kubelet/apis/cri"
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
"k8s.io/kubernetes/pkg/kubelet/cm/cpumanager"
"k8s.io/kubernetes/pkg/kubelet/cm/cpumanager"
"k8s.io/kubernetes/pkg/kubelet/cm/device
plugin
"
"k8s.io/kubernetes/pkg/kubelet/cm/device
manager
"
cmutil
"k8s.io/kubernetes/pkg/kubelet/cm/util"
cmutil
"k8s.io/kubernetes/pkg/kubelet/cm/util"
"k8s.io/kubernetes/pkg/kubelet/config"
"k8s.io/kubernetes/pkg/kubelet/config"
kubecontainer
"k8s.io/kubernetes/pkg/kubelet/container"
kubecontainer
"k8s.io/kubernetes/pkg/kubelet/container"
...
@@ -129,7 +129,7 @@ type containerManagerImpl struct {
...
@@ -129,7 +129,7 @@ type containerManagerImpl struct {
// Interface for QoS cgroup management
// Interface for QoS cgroup management
qosContainerManager
QOSContainerManager
qosContainerManager
QOSContainerManager
// Interface for exporting and allocating devices reported by device plugins.
// Interface for exporting and allocating devices reported by device plugins.
device
PluginManager
deviceplugin
.
Manager
device
Manager
devicemanager
.
Manager
// Interface for CPU affinity management.
// Interface for CPU affinity management.
cpuManager
cpumanager
.
Manager
cpuManager
cpumanager
.
Manager
}
}
...
@@ -265,9 +265,9 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I
...
@@ -265,9 +265,9 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I
glog
.
Infof
(
"Creating device plugin manager: %t"
,
devicePluginEnabled
)
glog
.
Infof
(
"Creating device plugin manager: %t"
,
devicePluginEnabled
)
if
devicePluginEnabled
{
if
devicePluginEnabled
{
cm
.
device
PluginManager
,
err
=
deviceplugin
.
NewManagerImpl
()
cm
.
device
Manager
,
err
=
devicemanager
.
NewManagerImpl
()
}
else
{
}
else
{
cm
.
device
PluginManager
,
err
=
deviceplugin
.
NewManagerStub
()
cm
.
device
Manager
,
err
=
devicemanager
.
NewManagerStub
()
}
}
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -586,8 +586,8 @@ func (cm *containerManagerImpl) Start(node *v1.Node,
...
@@ -586,8 +586,8 @@ func (cm *containerManagerImpl) Start(node *v1.Node,
close
(
stopChan
)
close
(
stopChan
)
},
time
.
Second
,
stopChan
)
},
time
.
Second
,
stopChan
)
// Starts device
plugin
manager.
// Starts device manager.
if
err
:=
cm
.
device
PluginManager
.
Start
(
deviceplugin
.
ActivePodsFunc
(
activePods
),
sourcesReady
);
err
!=
nil
{
if
err
:=
cm
.
device
Manager
.
Start
(
devicemanager
.
ActivePodsFunc
(
activePods
),
sourcesReady
);
err
!=
nil
{
return
err
return
err
}
}
return
nil
return
nil
...
@@ -612,7 +612,7 @@ func (cm *containerManagerImpl) GetResources(pod *v1.Pod, container *v1.Containe
...
@@ -612,7 +612,7 @@ func (cm *containerManagerImpl) GetResources(pod *v1.Pod, container *v1.Containe
opts
:=
&
kubecontainer
.
RunContainerOptions
{}
opts
:=
&
kubecontainer
.
RunContainerOptions
{}
// Allocate should already be called during predicateAdmitHandler.Admit(),
// Allocate should already be called during predicateAdmitHandler.Admit(),
// just try to fetch device runtime information from cached state here
// just try to fetch device runtime information from cached state here
devOpts
:=
cm
.
device
Plugin
Manager
.
GetDeviceRunContainerOptions
(
pod
,
container
)
devOpts
:=
cm
.
deviceManager
.
GetDeviceRunContainerOptions
(
pod
,
container
)
if
devOpts
==
nil
{
if
devOpts
==
nil
{
return
opts
,
nil
return
opts
,
nil
}
}
...
@@ -623,7 +623,7 @@ func (cm *containerManagerImpl) GetResources(pod *v1.Pod, container *v1.Containe
...
@@ -623,7 +623,7 @@ func (cm *containerManagerImpl) GetResources(pod *v1.Pod, container *v1.Containe
}
}
func
(
cm
*
containerManagerImpl
)
UpdatePluginResources
(
node
*
schedulercache
.
NodeInfo
,
attrs
*
lifecycle
.
PodAdmitAttributes
)
error
{
func
(
cm
*
containerManagerImpl
)
UpdatePluginResources
(
node
*
schedulercache
.
NodeInfo
,
attrs
*
lifecycle
.
PodAdmitAttributes
)
error
{
return
cm
.
device
Plugin
Manager
.
Allocate
(
node
,
attrs
)
return
cm
.
deviceManager
.
Allocate
(
node
,
attrs
)
}
}
func
(
cm
*
containerManagerImpl
)
SystemCgroupsLimit
()
v1
.
ResourceList
{
func
(
cm
*
containerManagerImpl
)
SystemCgroupsLimit
()
v1
.
ResourceList
{
...
@@ -888,5 +888,5 @@ func (cm *containerManagerImpl) GetCapacity() v1.ResourceList {
...
@@ -888,5 +888,5 @@ func (cm *containerManagerImpl) GetCapacity() v1.ResourceList {
}
}
func
(
cm
*
containerManagerImpl
)
GetDevicePluginResourceCapacity
()
(
v1
.
ResourceList
,
v1
.
ResourceList
,
[]
string
)
{
func
(
cm
*
containerManagerImpl
)
GetDevicePluginResourceCapacity
()
(
v1
.
ResourceList
,
v1
.
ResourceList
,
[]
string
)
{
return
cm
.
device
Plugin
Manager
.
GetCapacity
()
return
cm
.
deviceManager
.
GetCapacity
()
}
}
pkg/kubelet/cm/device
plugin
/BUILD
→
pkg/kubelet/cm/device
manager
/BUILD
View file @
e5667cf4
package(default_visibility = ["//visibility:public"])
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)
go_library(
go_library(
name = "go_default_library",
name = "go_default_library",
...
@@ -16,7 +10,8 @@ go_library(
...
@@ -16,7 +10,8 @@ go_library(
"pod_devices.go",
"pod_devices.go",
"types.go",
"types.go",
],
],
importpath = "k8s.io/kubernetes/pkg/kubelet/cm/deviceplugin",
importpath = "k8s.io/kubernetes/pkg/kubelet/cm/devicemanager",
visibility = ["//visibility:public"],
deps = [
deps = [
"//pkg/apis/core/v1/helper:go_default_library",
"//pkg/apis/core/v1/helper:go_default_library",
"//pkg/kubelet/apis/deviceplugin/v1alpha:go_default_library",
"//pkg/kubelet/apis/deviceplugin/v1alpha:go_default_library",
...
@@ -36,19 +31,6 @@ go_library(
...
@@ -36,19 +31,6 @@ go_library(
],
],
)
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
go_test(
go_test(
name = "go_default_test",
name = "go_default_test",
srcs = [
srcs = [
...
@@ -56,7 +38,7 @@ go_test(
...
@@ -56,7 +38,7 @@ go_test(
"manager_test.go",
"manager_test.go",
],
],
embed = [":go_default_library"],
embed = [":go_default_library"],
importpath = "k8s.io/kubernetes/pkg/kubelet/cm/device
plugin
",
importpath = "k8s.io/kubernetes/pkg/kubelet/cm/device
manager
",
deps = [
deps = [
"//pkg/kubelet/apis/deviceplugin/v1alpha:go_default_library",
"//pkg/kubelet/apis/deviceplugin/v1alpha:go_default_library",
"//pkg/kubelet/lifecycle:go_default_library",
"//pkg/kubelet/lifecycle:go_default_library",
...
@@ -72,3 +54,17 @@ go_test(
...
@@ -72,3 +54,17 @@ go_test(
"//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
],
],
)
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
pkg/kubelet/cm/device
plugin
/OWNERS
→
pkg/kubelet/cm/device
manager
/OWNERS
View file @
e5667cf4
File moved
pkg/kubelet/cm/device
plugin
/device_plugin_stub.go
→
pkg/kubelet/cm/device
manager
/device_plugin_stub.go
View file @
e5667cf4
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
device
plugin
package
device
manager
import
(
import
(
"log"
"log"
...
...
pkg/kubelet/cm/device
plugin
/endpoint.go
→
pkg/kubelet/cm/device
manager
/endpoint.go
View file @
e5667cf4
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
device
plugin
package
device
manager
import
(
import
(
"fmt"
"fmt"
...
...
pkg/kubelet/cm/device
plugin
/endpoint_test.go
→
pkg/kubelet/cm/device
manager
/endpoint_test.go
View file @
e5667cf4
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
device
plugin
package
device
manager
import
(
import
(
"path"
"path"
...
...
pkg/kubelet/cm/device
plugin
/manager.go
→
pkg/kubelet/cm/device
manager
/manager.go
View file @
e5667cf4
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
device
plugin
package
device
manager
import
(
import
(
"encoding/json"
"encoding/json"
...
@@ -187,13 +187,13 @@ func (m *ManagerImpl) removeContents(dir string) error {
...
@@ -187,13 +187,13 @@ func (m *ManagerImpl) removeContents(dir string) error {
}
}
const
(
const
(
// kubeletDevice
Plugin
Checkpoint is the file name of device plugin checkpoint
// kubeletDevice
Manager
Checkpoint is the file name of device plugin checkpoint
kubeletDevice
Plugin
Checkpoint
=
"kubelet_internal_checkpoint"
kubeletDevice
Manager
Checkpoint
=
"kubelet_internal_checkpoint"
)
)
// checkpointFile returns device plugin checkpoint file path.
// checkpointFile returns device plugin checkpoint file path.
func
(
m
*
ManagerImpl
)
checkpointFile
()
string
{
func
(
m
*
ManagerImpl
)
checkpointFile
()
string
{
return
filepath
.
Join
(
m
.
socketdir
,
kubeletDevice
Plugin
Checkpoint
)
return
filepath
.
Join
(
m
.
socketdir
,
kubeletDevice
Manager
Checkpoint
)
}
}
// Start starts the Device Plugin Manager amd start initialization of
// Start starts the Device Plugin Manager amd start initialization of
...
@@ -456,9 +456,9 @@ func (m *ManagerImpl) writeCheckpoint() error {
...
@@ -456,9 +456,9 @@ func (m *ManagerImpl) writeCheckpoint() error {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
err
=
m
.
store
.
Write
(
kubeletDevice
Plugin
Checkpoint
,
dataJSON
)
err
=
m
.
store
.
Write
(
kubeletDevice
Manager
Checkpoint
,
dataJSON
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to write deviceplugin checkpoint file %q: %v"
,
kubeletDevice
Plugin
Checkpoint
,
err
)
return
fmt
.
Errorf
(
"failed to write deviceplugin checkpoint file %q: %v"
,
kubeletDevice
Manager
Checkpoint
,
err
)
}
}
return
nil
return
nil
}
}
...
@@ -466,14 +466,14 @@ func (m *ManagerImpl) writeCheckpoint() error {
...
@@ -466,14 +466,14 @@ func (m *ManagerImpl) writeCheckpoint() error {
// Reads device to container allocation information from disk, and populates
// Reads device to container allocation information from disk, and populates
// m.allocatedDevices accordingly.
// m.allocatedDevices accordingly.
func
(
m
*
ManagerImpl
)
readCheckpoint
()
error
{
func
(
m
*
ManagerImpl
)
readCheckpoint
()
error
{
content
,
err
:=
m
.
store
.
Read
(
kubeletDevice
Plugin
Checkpoint
)
content
,
err
:=
m
.
store
.
Read
(
kubeletDevice
Manager
Checkpoint
)
if
err
!=
nil
{
if
err
!=
nil
{
if
err
==
utilstore
.
ErrKeyNotFound
{
if
err
==
utilstore
.
ErrKeyNotFound
{
return
nil
return
nil
}
}
return
fmt
.
Errorf
(
"failed to read checkpoint file %q: %v"
,
kubeletDevice
Plugin
Checkpoint
,
err
)
return
fmt
.
Errorf
(
"failed to read checkpoint file %q: %v"
,
kubeletDevice
Manager
Checkpoint
,
err
)
}
}
glog
.
V
(
4
)
.
Infof
(
"Read checkpoint file %s
\n
"
,
kubeletDevice
Plugin
Checkpoint
)
glog
.
V
(
4
)
.
Infof
(
"Read checkpoint file %s
\n
"
,
kubeletDevice
Manager
Checkpoint
)
var
data
checkpointData
var
data
checkpointData
if
err
:=
json
.
Unmarshal
(
content
,
&
data
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
(
content
,
&
data
);
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to unmarshal deviceplugin checkpoint data: %v"
,
err
)
return
fmt
.
Errorf
(
"failed to unmarshal deviceplugin checkpoint data: %v"
,
err
)
...
@@ -611,7 +611,7 @@ func (m *ManagerImpl) allocateContainerResources(pod *v1.Pod, container *v1.Cont
...
@@ -611,7 +611,7 @@ func (m *ManagerImpl) allocateContainerResources(pod *v1.Pod, container *v1.Cont
continue
continue
}
}
startRPCTime
:=
time
.
Now
()
startRPCTime
:=
time
.
Now
()
//
devicePlugin
Manager.Allocate involves RPC calls to device plugin, which
// Manager.Allocate involves RPC calls to device plugin, which
// could be heavy-weight. Therefore we want to perform this operation outside
// could be heavy-weight. Therefore we want to perform this operation outside
// mutex lock. Note if Allocate call fails, we may leave container resources
// mutex lock. Note if Allocate call fails, we may leave container resources
// partially allocated for the failed container. We rely on updateAllocatedDevices()
// partially allocated for the failed container. We rely on updateAllocatedDevices()
...
...
pkg/kubelet/cm/device
plugin
/manager_stub.go
→
pkg/kubelet/cm/device
manager
/manager_stub.go
View file @
e5667cf4
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
device
plugin
package
device
manager
import
(
import
(
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
...
...
pkg/kubelet/cm/device
plugin
/manager_test.go
→
pkg/kubelet/cm/device
manager
/manager_test.go
View file @
e5667cf4
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
device
plugin
package
device
manager
import
(
import
(
"flag"
"flag"
...
...
pkg/kubelet/cm/device
plugin
/pod_devices.go
→
pkg/kubelet/cm/device
manager
/pod_devices.go
View file @
e5667cf4
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
device
plugin
package
device
manager
import
(
import
(
"github.com/golang/glog"
"github.com/golang/glog"
...
...
pkg/kubelet/cm/device
plugin
/types.go
→
pkg/kubelet/cm/device
manager
/types.go
View file @
e5667cf4
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
device
plugin
package
device
manager
import
(
import
(
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
...
...
test/e2e_node/BUILD
View file @
e5667cf4
package(default_visibility = ["//visibility:public"])
package(default_visibility = ["//visibility:public"])
load(
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)
go_library(
go_library(
name = "go_default_library",
name = "go_default_library",
...
@@ -28,6 +24,7 @@ go_library(
...
@@ -28,6 +24,7 @@ go_library(
"//conditions:default": [],
"//conditions:default": [],
}),
}),
importpath = "k8s.io/kubernetes/test/e2e_node",
importpath = "k8s.io/kubernetes/test/e2e_node",
visibility = ["//visibility:public"],
deps = [
deps = [
"//pkg/api/v1/pod:go_default_library",
"//pkg/api/v1/pod:go_default_library",
"//pkg/features:go_default_library",
"//pkg/features:go_default_library",
...
@@ -38,7 +35,7 @@ go_library(
...
@@ -38,7 +35,7 @@ go_library(
"//pkg/kubelet/apis/kubeletconfig/scheme:go_default_library",
"//pkg/kubelet/apis/kubeletconfig/scheme:go_default_library",
"//pkg/kubelet/apis/kubeletconfig/v1alpha1:go_default_library",
"//pkg/kubelet/apis/kubeletconfig/v1alpha1:go_default_library",
"//pkg/kubelet/apis/stats/v1alpha1:go_default_library",
"//pkg/kubelet/apis/stats/v1alpha1:go_default_library",
"//pkg/kubelet/cm/device
plugin
:go_default_library",
"//pkg/kubelet/cm/device
manager
:go_default_library",
"//pkg/kubelet/metrics:go_default_library",
"//pkg/kubelet/metrics:go_default_library",
"//pkg/kubelet/remote:go_default_library",
"//pkg/kubelet/remote:go_default_library",
"//test/e2e/common:go_default_library",
"//test/e2e/common:go_default_library",
...
@@ -210,4 +207,5 @@ filegroup(
...
@@ -210,4 +207,5 @@ filegroup(
"//test/e2e_node/system:all-srcs",
"//test/e2e_node/system:all-srcs",
],
],
tags = ["automanaged"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
)
test/e2e_node/device_plugin.go
View file @
e5667cf4
...
@@ -34,7 +34,7 @@ import (
...
@@ -34,7 +34,7 @@ import (
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1alpha"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1alpha"
d
p
"k8s.io/kubernetes/pkg/kubelet/cm/deviceplugin
"
d
m
"k8s.io/kubernetes/pkg/kubelet/cm/devicemanager
"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/gomega"
.
"github.com/onsi/gomega"
...
@@ -69,7 +69,7 @@ var _ = framework.KubeDescribe("Device Plugin [Feature:DevicePlugin] [Serial] [D
...
@@ -69,7 +69,7 @@ var _ = framework.KubeDescribe("Device Plugin [Feature:DevicePlugin] [Serial] [D
socketPath
:=
pluginapi
.
DevicePluginPath
+
"dp."
+
fmt
.
Sprintf
(
"%d"
,
time
.
Now
()
.
Unix
())
socketPath
:=
pluginapi
.
DevicePluginPath
+
"dp."
+
fmt
.
Sprintf
(
"%d"
,
time
.
Now
()
.
Unix
())
dp1
:=
d
p
.
NewDevicePluginStub
(
devs
,
socketPath
)
dp1
:=
d
m
.
NewDevicePluginStub
(
devs
,
socketPath
)
dp1
.
SetAllocFunc
(
stubAllocFunc
)
dp1
.
SetAllocFunc
(
stubAllocFunc
)
err
:=
dp1
.
Start
()
err
:=
dp1
.
Start
()
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
...
@@ -107,7 +107,7 @@ var _ = framework.KubeDescribe("Device Plugin [Feature:DevicePlugin] [Serial] [D
...
@@ -107,7 +107,7 @@ var _ = framework.KubeDescribe("Device Plugin [Feature:DevicePlugin] [Serial] [D
framework
.
WaitForAllNodesSchedulable
(
f
.
ClientSet
,
framework
.
TestContext
.
NodeSchedulableTimeout
)
framework
.
WaitForAllNodesSchedulable
(
f
.
ClientSet
,
framework
.
TestContext
.
NodeSchedulableTimeout
)
By
(
"Re-Register resources"
)
By
(
"Re-Register resources"
)
dp1
=
d
p
.
NewDevicePluginStub
(
devs
,
socketPath
)
dp1
=
d
m
.
NewDevicePluginStub
(
devs
,
socketPath
)
dp1
.
SetAllocFunc
(
stubAllocFunc
)
dp1
.
SetAllocFunc
(
stubAllocFunc
)
err
=
dp1
.
Start
()
err
=
dp1
.
Start
()
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment