Skip to content

Commit 561b562

Browse files
committed
fix uts
1 parent 396ddb8 commit 561b562

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cns/deviceplugin/server.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ type deviceCounter interface {
2020
}
2121

2222
type Server struct {
23+
// NEW: embed the unimplemented server to satisfy the interface in newer gRPC/proto
24+
v1beta1.UnimplementedDevicePluginServer
25+
2326
address string
2427
logger *zap.Logger
2528
deviceCounter deviceCounter
@@ -94,8 +97,8 @@ func (s *Server) Allocate(_ context.Context, req *v1beta1.AllocateRequest) (*v1b
9497
resp := &v1beta1.ContainerAllocateResponse{
9598
Envs: make(map[string]string),
9699
}
97-
for j := range containerReq.DevicesIDs {
98-
resp.Envs[fmt.Sprintf("%s%d", devicePrefix, j)] = containerReq.DevicesIDs[j]
100+
for j := range containerReq.DevicesIds {
101+
resp.Envs[fmt.Sprintf("%s%d", devicePrefix, j)] = containerReq.DevicesIds[j]
99102
}
100103
resps[i] = resp
101104
}

0 commit comments

Comments
 (0)