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
e64517cd
Commit
e64517cd
authored
Feb 15, 2018
by
vikaschoudhary16
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate deviceplugin api from v1alpha to v1beta1
parent
defcab81
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
99 additions
and
85 deletions
+99
-85
BUILD
pkg/kubelet/apis/deviceplugin/v1beta1/BUILD
+5
-0
api.pb.go
pkg/kubelet/apis/deviceplugin/v1beta1/api.pb.go
+66
-66
api.proto
pkg/kubelet/apis/deviceplugin/v1beta1/api.proto
+1
-1
constants.go
pkg/kubelet/apis/deviceplugin/v1beta1/constants.go
+2
-0
BUILD
pkg/kubelet/cm/devicemanager/BUILD
+2
-2
device_plugin_stub.go
pkg/kubelet/cm/devicemanager/device_plugin_stub.go
+1
-1
endpoint.go
pkg/kubelet/cm/devicemanager/endpoint.go
+3
-4
endpoint_test.go
pkg/kubelet/cm/devicemanager/endpoint_test.go
+1
-1
manager.go
pkg/kubelet/cm/devicemanager/manager.go
+10
-3
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
+2
-2
nvidia-gpus.go
test/e2e/scheduling/nvidia-gpus.go
+1
-0
BUILD
test/e2e_node/BUILD
+1
-1
device_plugin.go
test/e2e_node/device_plugin.go
+1
-1
No files found.
pkg/kubelet/apis/deviceplugin/v1beta1/BUILD
View file @
e64517cd
...
...
@@ -33,3 +33,8 @@ filegroup(
srcs = [":package-srcs"],
tags = ["automanaged"],
)
filegroup(
name = "go_default_library_protos",
srcs = ["api.proto"],
)
pkg/kubelet/apis/deviceplugin/v1beta1/api.pb.go
View file @
e64517cd
...
...
@@ -19,7 +19,7 @@ limitations under the License.
// DO NOT EDIT!
/*
Package
deviceplugin
is a generated protocol buffer package.
Package
v1beta1
is a generated protocol buffer package.
It is generated from these files:
api.proto
...
...
@@ -37,7 +37,7 @@ limitations under the License.
Mount
DeviceSpec
*/
package
deviceplugin
package
v1beta1
import
proto
"github.com/gogo/protobuf/proto"
import
fmt
"fmt"
...
...
@@ -357,17 +357,17 @@ func (m *DeviceSpec) GetPermissions() string {
}
func
init
()
{
proto
.
RegisterType
((
*
DevicePluginOptions
)(
nil
),
"
deviceplugin
.DevicePluginOptions"
)
proto
.
RegisterType
((
*
RegisterRequest
)(
nil
),
"
deviceplugin
.RegisterRequest"
)
proto
.
RegisterType
((
*
Empty
)(
nil
),
"
deviceplugin
.Empty"
)
proto
.
RegisterType
((
*
ListAndWatchResponse
)(
nil
),
"
deviceplugin
.ListAndWatchResponse"
)
proto
.
RegisterType
((
*
Device
)(
nil
),
"
deviceplugin
.Device"
)
proto
.
RegisterType
((
*
PreStartContainerRequest
)(
nil
),
"
deviceplugin
.PreStartContainerRequest"
)
proto
.
RegisterType
((
*
PreStartContainerResponse
)(
nil
),
"
deviceplugin
.PreStartContainerResponse"
)
proto
.
RegisterType
((
*
AllocateRequest
)(
nil
),
"
deviceplugin
.AllocateRequest"
)
proto
.
RegisterType
((
*
AllocateResponse
)(
nil
),
"
deviceplugin
.AllocateResponse"
)
proto
.
RegisterType
((
*
Mount
)(
nil
),
"
deviceplugin
.Mount"
)
proto
.
RegisterType
((
*
DeviceSpec
)(
nil
),
"
deviceplugin
.DeviceSpec"
)
proto
.
RegisterType
((
*
DevicePluginOptions
)(
nil
),
"
v1beta1
.DevicePluginOptions"
)
proto
.
RegisterType
((
*
RegisterRequest
)(
nil
),
"
v1beta1
.RegisterRequest"
)
proto
.
RegisterType
((
*
Empty
)(
nil
),
"
v1beta1
.Empty"
)
proto
.
RegisterType
((
*
ListAndWatchResponse
)(
nil
),
"
v1beta1
.ListAndWatchResponse"
)
proto
.
RegisterType
((
*
Device
)(
nil
),
"
v1beta1
.Device"
)
proto
.
RegisterType
((
*
PreStartContainerRequest
)(
nil
),
"
v1beta1
.PreStartContainerRequest"
)
proto
.
RegisterType
((
*
PreStartContainerResponse
)(
nil
),
"
v1beta1
.PreStartContainerResponse"
)
proto
.
RegisterType
((
*
AllocateRequest
)(
nil
),
"
v1beta1
.AllocateRequest"
)
proto
.
RegisterType
((
*
AllocateResponse
)(
nil
),
"
v1beta1
.AllocateResponse"
)
proto
.
RegisterType
((
*
Mount
)(
nil
),
"
v1beta1
.Mount"
)
proto
.
RegisterType
((
*
DeviceSpec
)(
nil
),
"
v1beta1
.DeviceSpec"
)
}
// Reference imports to suppress errors if they are not otherwise used.
...
...
@@ -394,7 +394,7 @@ func NewRegistrationClient(cc *grpc.ClientConn) RegistrationClient {
func
(
c
*
registrationClient
)
Register
(
ctx
context
.
Context
,
in
*
RegisterRequest
,
opts
...
grpc
.
CallOption
)
(
*
Empty
,
error
)
{
out
:=
new
(
Empty
)
err
:=
grpc
.
Invoke
(
ctx
,
"/
deviceplugin
.Registration/Register"
,
in
,
out
,
c
.
cc
,
opts
...
)
err
:=
grpc
.
Invoke
(
ctx
,
"/
v1beta1
.Registration/Register"
,
in
,
out
,
c
.
cc
,
opts
...
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -421,7 +421,7 @@ func _Registration_Register_Handler(srv interface{}, ctx context.Context, dec fu
}
info
:=
&
grpc
.
UnaryServerInfo
{
Server
:
srv
,
FullMethod
:
"/
deviceplugin
.Registration/Register"
,
FullMethod
:
"/
v1beta1
.Registration/Register"
,
}
handler
:=
func
(
ctx
context
.
Context
,
req
interface
{})
(
interface
{},
error
)
{
return
srv
.
(
RegistrationServer
)
.
Register
(
ctx
,
req
.
(
*
RegisterRequest
))
...
...
@@ -430,7 +430,7 @@ func _Registration_Register_Handler(srv interface{}, ctx context.Context, dec fu
}
var
_Registration_serviceDesc
=
grpc
.
ServiceDesc
{
ServiceName
:
"
deviceplugin
.Registration"
,
ServiceName
:
"
v1beta1
.Registration"
,
HandlerType
:
(
*
RegistrationServer
)(
nil
),
Methods
:
[]
grpc
.
MethodDesc
{
{
...
...
@@ -468,7 +468,7 @@ func NewDevicePluginClient(cc *grpc.ClientConn) DevicePluginClient {
}
func
(
c
*
devicePluginClient
)
ListAndWatch
(
ctx
context
.
Context
,
in
*
Empty
,
opts
...
grpc
.
CallOption
)
(
DevicePlugin_ListAndWatchClient
,
error
)
{
stream
,
err
:=
grpc
.
NewClientStream
(
ctx
,
&
_DevicePlugin_serviceDesc
.
Streams
[
0
],
c
.
cc
,
"/
deviceplugin
.DevicePlugin/ListAndWatch"
,
opts
...
)
stream
,
err
:=
grpc
.
NewClientStream
(
ctx
,
&
_DevicePlugin_serviceDesc
.
Streams
[
0
],
c
.
cc
,
"/
v1beta1
.DevicePlugin/ListAndWatch"
,
opts
...
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -501,7 +501,7 @@ func (x *devicePluginListAndWatchClient) Recv() (*ListAndWatchResponse, error) {
func
(
c
*
devicePluginClient
)
Allocate
(
ctx
context
.
Context
,
in
*
AllocateRequest
,
opts
...
grpc
.
CallOption
)
(
*
AllocateResponse
,
error
)
{
out
:=
new
(
AllocateResponse
)
err
:=
grpc
.
Invoke
(
ctx
,
"/
deviceplugin
.DevicePlugin/Allocate"
,
in
,
out
,
c
.
cc
,
opts
...
)
err
:=
grpc
.
Invoke
(
ctx
,
"/
v1beta1
.DevicePlugin/Allocate"
,
in
,
out
,
c
.
cc
,
opts
...
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -510,7 +510,7 @@ func (c *devicePluginClient) Allocate(ctx context.Context, in *AllocateRequest,
func
(
c
*
devicePluginClient
)
PreStartContainer
(
ctx
context
.
Context
,
in
*
PreStartContainerRequest
,
opts
...
grpc
.
CallOption
)
(
*
PreStartContainerResponse
,
error
)
{
out
:=
new
(
PreStartContainerResponse
)
err
:=
grpc
.
Invoke
(
ctx
,
"/
deviceplugin
.DevicePlugin/PreStartContainer"
,
in
,
out
,
c
.
cc
,
opts
...
)
err
:=
grpc
.
Invoke
(
ctx
,
"/
v1beta1
.DevicePlugin/PreStartContainer"
,
in
,
out
,
c
.
cc
,
opts
...
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -569,7 +569,7 @@ func _DevicePlugin_Allocate_Handler(srv interface{}, ctx context.Context, dec fu
}
info
:=
&
grpc
.
UnaryServerInfo
{
Server
:
srv
,
FullMethod
:
"/
deviceplugin
.DevicePlugin/Allocate"
,
FullMethod
:
"/
v1beta1
.DevicePlugin/Allocate"
,
}
handler
:=
func
(
ctx
context
.
Context
,
req
interface
{})
(
interface
{},
error
)
{
return
srv
.
(
DevicePluginServer
)
.
Allocate
(
ctx
,
req
.
(
*
AllocateRequest
))
...
...
@@ -587,7 +587,7 @@ func _DevicePlugin_PreStartContainer_Handler(srv interface{}, ctx context.Contex
}
info
:=
&
grpc
.
UnaryServerInfo
{
Server
:
srv
,
FullMethod
:
"/
deviceplugin
.DevicePlugin/PreStartContainer"
,
FullMethod
:
"/
v1beta1
.DevicePlugin/PreStartContainer"
,
}
handler
:=
func
(
ctx
context
.
Context
,
req
interface
{})
(
interface
{},
error
)
{
return
srv
.
(
DevicePluginServer
)
.
PreStartContainer
(
ctx
,
req
.
(
*
PreStartContainerRequest
))
...
...
@@ -596,7 +596,7 @@ func _DevicePlugin_PreStartContainer_Handler(srv interface{}, ctx context.Contex
}
var
_DevicePlugin_serviceDesc
=
grpc
.
ServiceDesc
{
ServiceName
:
"
deviceplugin
.DevicePlugin"
,
ServiceName
:
"
v1beta1
.DevicePlugin"
,
HandlerType
:
(
*
DevicePluginServer
)(
nil
),
Methods
:
[]
grpc
.
MethodDesc
{
{
...
...
@@ -2759,48 +2759,48 @@ var (
func
init
()
{
proto
.
RegisterFile
(
"api.proto"
,
fileDescriptorApi
)
}
var
fileDescriptorApi
=
[]
byte
{
// 68
7
bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0xac
,
0x54
,
0x
cd
,
0x6e
,
0xd3
,
0x40
,
0x1
0
,
0x8e
,
0x93
,
0x36
,
0x3f
,
0x93
,
0xb4
,
0x0d
,
0xdb
,
0x0a
,
0x19
,
0x17
,
0xac
,
0x60
,
0x04
,
0x44
,
0x
02
,
0xd2
,
0x12
,
0x0e
,
0xa0
,
0x82
,
0x10
,
0xa5
,
0x29
,
0x52
,
0x55
,
0xa0
,
0xc1
,
0x3d
,
0x70
,
0x8c
,
0x
b6
,
0xce
,
0x36
,
0xb6
,
0x70
,
0x76
,
0xcd
,
0xee
,
0x3a
,
0x52
,
0x6e
,
0x3c
,
0x42
,
0x5f
,
0x83
,
0x37
,
0x
e9
,
0x91
,
0x23
,
0x47
,
0x1a
,
0x9e
,
0x03
,
0x09
,
0x79
,
0x6d
,
0xe7
,
0x8f
,
0x40
,
0x41
,
0xe2
,
0xe6
,
0x
f9
,
0x76
,
0xbe
,
0xf1
,
0xcc
,
0xb7
,
0xfb
,
0x0d
,
0x94
,
0x70
,
0xe0
,
0x35
,
0x02
,
0xce
,
0x24
,
0x43
,
0x
95
,
0x2e
,
0x19
,
0x78
,
0x0e
,
0x09
,
0xfc
,
0xb0
,
0xe7
,
0x51
,
0xe3
,
0x41
,
0xcf
,
0x93
,
0x6e
,
0x7
8
,
0x
d2
,
0x70
,
0x58
,
0x7f
,
0xab
,
0xc7
,
0x7a
,
0x6c
,
0x4b
,
0x25
,
0x9d
,
0x84
,
0xa7
,
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x0f
,
0x
fd
,
0xf4
,
0x57
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0xad
,
0x28
,
0x13
,
0x30
,
0xe6
,
0x05
,
0x00
,
0x00
,
}
pkg/kubelet/apis/deviceplugin/v1beta1/api.proto
View file @
e64517cd
// To regenerate api.pb.go run hack/update-device-plugin.sh
syntax
=
'proto3'
;
package
deviceplugin
;
package
v1beta1
;
import
"github.com/gogo/protobuf/gogoproto/gogo.proto"
;
...
...
pkg/kubelet/apis/deviceplugin/v1beta1/constants.go
View file @
e64517cd
...
...
@@ -33,3 +33,5 @@ const (
// Timeout duration in secs for PreStartContainer RPC
KubeletPreStartContainerRPCTimeoutInSecs
=
30
)
var
SupportedVersions
=
[
...
]
string
{
"v1beta1"
}
pkg/kubelet/cm/devicemanager/BUILD
View file @
e64517cd
...
...
@@ -14,7 +14,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/core/v1/helper:go_default_library",
"//pkg/kubelet/apis/deviceplugin/v1
alpha
:go_default_library",
"//pkg/kubelet/apis/deviceplugin/v1
beta1
:go_default_library",
"//pkg/kubelet/config:go_default_library",
"//pkg/kubelet/container:go_default_library",
"//pkg/kubelet/lifecycle:go_default_library",
...
...
@@ -39,7 +39,7 @@ go_test(
],
embed = [":go_default_library"],
deps = [
"//pkg/kubelet/apis/deviceplugin/v1
alpha
:go_default_library",
"//pkg/kubelet/apis/deviceplugin/v1
beta1
:go_default_library",
"//pkg/kubelet/lifecycle:go_default_library",
"//pkg/kubelet/util/store:go_default_library",
"//pkg/scheduler/schedulercache:go_default_library",
...
...
pkg/kubelet/cm/devicemanager/device_plugin_stub.go
View file @
e64517cd
...
...
@@ -26,7 +26,7 @@ import (
"golang.org/x/net/context"
"google.golang.org/grpc"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
alpha
"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
beta1
"
)
// Stub implementation for DevicePlugin.
...
...
pkg/kubelet/cm/devicemanager/endpoint.go
View file @
e64517cd
...
...
@@ -26,7 +26,7 @@ import (
"golang.org/x/net/context"
"google.golang.org/grpc"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
alpha
"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
beta1
"
)
// endpoint maps to a single registered device plugin. It is responsible
...
...
@@ -66,9 +66,8 @@ func newEndpointImpl(socketPath, resourceName string, devices map[string]plugina
client
:
client
,
clientConn
:
c
,
socketPath
:
socketPath
,
resourceName
:
resourceName
,
invokePreStartContainerBoolFlag
:
false
,
socketPath
:
socketPath
,
resourceName
:
resourceName
,
devices
:
devices
,
cb
:
callback
,
...
...
pkg/kubelet/cm/devicemanager/endpoint_test.go
View file @
e64517cd
...
...
@@ -23,7 +23,7 @@ import (
"github.com/stretchr/testify/require"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
alpha
"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
beta1
"
)
var
(
...
...
pkg/kubelet/cm/devicemanager/manager.go
View file @
e64517cd
...
...
@@ -33,7 +33,7 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/sets"
v1helper
"k8s.io/kubernetes/pkg/apis/core/v1/helper"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
alpha
"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
beta1
"
"k8s.io/kubernetes/pkg/kubelet/config"
"k8s.io/kubernetes/pkg/kubelet/lifecycle"
"k8s.io/kubernetes/pkg/kubelet/metrics"
...
...
@@ -289,8 +289,15 @@ func (m *ManagerImpl) Allocate(node *schedulercache.NodeInfo, attrs *lifecycle.P
func
(
m
*
ManagerImpl
)
Register
(
ctx
context
.
Context
,
r
*
pluginapi
.
RegisterRequest
)
(
*
pluginapi
.
Empty
,
error
)
{
glog
.
Infof
(
"Got registration request from device plugin with resource name %q"
,
r
.
ResourceName
)
metrics
.
DevicePluginRegistrationCount
.
WithLabelValues
(
r
.
ResourceName
)
.
Inc
()
if
r
.
Version
!=
pluginapi
.
Version
{
errorString
:=
fmt
.
Sprintf
(
errUnsupportedVersion
,
r
.
Version
,
pluginapi
.
Version
)
var
versionCompatible
bool
for
_
,
v
:=
range
pluginapi
.
SupportedVersions
{
if
r
.
Version
==
v
{
versionCompatible
=
true
break
}
}
if
!
versionCompatible
{
errorString
:=
fmt
.
Sprintf
(
errUnsupportedVersion
,
r
.
Version
,
pluginapi
.
SupportedVersions
)
glog
.
Infof
(
"Bad registration request from device plugin with resource name %q: %v"
,
r
.
ResourceName
,
errorString
)
return
&
pluginapi
.
Empty
{},
fmt
.
Errorf
(
errorString
)
}
...
...
pkg/kubelet/cm/devicemanager/manager_stub.go
View file @
e64517cd
...
...
@@ -18,7 +18,7 @@ package devicemanager
import
(
"k8s.io/api/core/v1"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
alpha
"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
beta1
"
"k8s.io/kubernetes/pkg/kubelet/config"
"k8s.io/kubernetes/pkg/kubelet/lifecycle"
"k8s.io/kubernetes/pkg/scheduler/schedulercache"
...
...
pkg/kubelet/cm/devicemanager/manager_test.go
View file @
e64517cd
...
...
@@ -33,7 +33,7 @@ import (
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/uuid"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
alpha
"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
beta1
"
"k8s.io/kubernetes/pkg/kubelet/lifecycle"
utilstore
"k8s.io/kubernetes/pkg/kubelet/util/store"
"k8s.io/kubernetes/pkg/scheduler/schedulercache"
...
...
pkg/kubelet/cm/devicemanager/pod_devices.go
View file @
e64517cd
...
...
@@ -20,7 +20,7 @@ import (
"github.com/golang/glog"
"k8s.io/apimachinery/pkg/util/sets"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
alpha
"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
beta1
"
kubecontainer
"k8s.io/kubernetes/pkg/kubelet/container"
)
...
...
pkg/kubelet/cm/devicemanager/types.go
View file @
e64517cd
...
...
@@ -18,7 +18,7 @@ package devicemanager
import
(
"k8s.io/api/core/v1"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
alpha
"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
beta1
"
"k8s.io/kubernetes/pkg/kubelet/config"
kubecontainer
"k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/kubelet/lifecycle"
...
...
@@ -77,7 +77,7 @@ const (
errFailedToDialDevicePlugin
=
"failed to dial device plugin:"
// errUnsupportedVersion is the error raised when the device plugin uses an API version not
// supported by the Kubelet registry
errUnsupportedVersion
=
"requested API version %q is not supported by kubelet. Supported version
is
%q"
errUnsupportedVersion
=
"requested API version %q is not supported by kubelet. Supported version
s are
%q"
// errDevicePluginAlreadyExists is the error raised when a device plugin with the
// same Resource Name tries to register itself
errDevicePluginAlreadyExists
=
"another device plugin already registered this Resource Name"
...
...
test/e2e/scheduling/nvidia-gpus.go
View file @
e64517cd
...
...
@@ -155,6 +155,7 @@ func getGPUsAvailable(f *framework.Framework) int64 {
func
SetupNVIDIAGPUNode
(
f
*
framework
.
Framework
,
setupResourceGatherer
bool
)
*
framework
.
ContainerResourceGatherer
{
Skip
(
"Temporarily disable the test till we update the device plugin image"
)
// Skip the test if the base image is not COS.
// TODO: Add support for other base images.
// CUDA apps require host mounts which is not portable across base images (yet).
...
...
test/e2e_node/BUILD
View file @
e64517cd
...
...
@@ -30,7 +30,7 @@ go_library(
"//pkg/features:go_default_library",
"//pkg/kubelet/apis/cri:go_default_library",
"//pkg/kubelet/apis/cri/runtime/v1alpha2:go_default_library",
"//pkg/kubelet/apis/deviceplugin/v1
alpha
:go_default_library",
"//pkg/kubelet/apis/deviceplugin/v1
beta1
:go_default_library",
"//pkg/kubelet/apis/kubeletconfig:go_default_library",
"//pkg/kubelet/apis/kubeletconfig/scheme:go_default_library",
"//pkg/kubelet/apis/kubeletconfig/v1beta1:go_default_library",
...
...
test/e2e_node/device_plugin.go
View file @
e64517cd
...
...
@@ -33,7 +33,7 @@ import (
"k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig"
"k8s.io/kubernetes/test/e2e/framework"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
alpha
"
pluginapi
"k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1
beta1
"
dm
"k8s.io/kubernetes/pkg/kubelet/cm/devicemanager"
.
"github.com/onsi/ginkgo"
...
...
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