Skip to content

Commit 5b7a0a4

Browse files
committed
update cdiresolver.proto
1 parent 44008ac commit 5b7a0a4

File tree

6 files changed

+54
-39
lines changed

6 files changed

+54
-39
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ require (
88
github.com/NVIDIA/gpu-monitoring-tools v0.0.0-20211102125545-5a2c58442e48
99
github.com/fsnotify/fsnotify v1.9.0
1010
github.com/google/uuid v1.6.0
11-
github.com/kata-containers/kata-containers/src/runtime v0.0.0-20250925190653-d1f52728ccdf
11+
github.com/kata-containers/kata-containers/src/runtime v0.0.0-20251030104659-e30e2b5f4527
1212
github.com/onsi/ginkgo/v2 v2.22.2
1313
github.com/onsi/gomega v1.36.2
14+
golang.org/x/sys v0.33.0
1415
google.golang.org/grpc v1.72.0
1516
k8s.io/klog/v2 v2.130.1
1617
k8s.io/kubelet v0.32.2
@@ -23,12 +24,11 @@ require (
2324
github.com/google/go-cmp v0.7.0 // indirect
2425
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
2526
golang.org/x/net v0.40.0 // indirect
26-
golang.org/x/sys v0.33.0 // indirect
2727
golang.org/x/text v0.25.0 // indirect
2828
golang.org/x/tools v0.28.0 // indirect
2929
google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 // indirect
3030
google.golang.org/protobuf v1.36.6 // indirect
3131
gopkg.in/yaml.v3 v3.0.1 // indirect
3232
)
3333

34-
replace github.com/kata-containers/kata-containers/src/runtime => github.com/jojimt/kata-containers/src/runtime v0.0.0-20250923214116-860bce0a244e
34+
replace github.com/kata-containers/kata-containers/src/runtime => github.com/jojimt/kata-containers/src/runtime v0.0.0-20251030193914-638e45702938

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAx
2323
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
2424
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
2525
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
26-
github.com/jojimt/kata-containers/src/runtime v0.0.0-20250923214116-860bce0a244e h1:Cz9ozgoy0waCfDZm1GYKF6uzDQu9yQU2z1/boCjcx2o=
27-
github.com/jojimt/kata-containers/src/runtime v0.0.0-20250923214116-860bce0a244e/go.mod h1:0rQOrgBfes0rQwLCq0M45K6jvFAascBubQb++OL14D4=
26+
github.com/jojimt/kata-containers/src/runtime v0.0.0-20251030193914-638e45702938 h1:k+hBNXiyrNDkPls4nQL+ZO6TsYh6Nlao9is5NnCZqIo=
27+
github.com/jojimt/kata-containers/src/runtime v0.0.0-20251030193914-638e45702938/go.mod h1:0rQOrgBfes0rQwLCq0M45K6jvFAascBubQb++OL14D4=
2828
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
2929
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
3030
github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU=

pkg/device_plugin/api.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (sas *SandboxAPIServer) AllocatePodDevices(ctx context.Context, pr *cdireso
166166
// check if this pod already has some devices assigned
167167
podDevices, exists := sas.podDeviceIDMap[pr.PodID]
168168
if exists && len(podDevices) == int(pr.Count) {
169-
response.PhysicalDeviceID = podDevices
169+
response.PhysicalDeviceIDs = podDevices
170170
log.Printf("[Info] Pod (already exists) Allocate Response: %v", response)
171171
return response, nil
172172
}
@@ -197,7 +197,7 @@ func (sas *SandboxAPIServer) AllocatePodDevices(ctx context.Context, pr *cdireso
197197
// in fact put the iommu_fd/iommu_id instead of the dev itself
198198
physicalDevices = append(physicalDevices, dev)
199199
}
200-
response.PhysicalDeviceID = physicalDevices
200+
response.PhysicalDeviceIDs = physicalDevices
201201

202202
log.Printf("[Info] Pod Allocate Response: %v", response)
203203
return response, nil
@@ -221,7 +221,7 @@ func (sas *SandboxAPIServer) AllocateContainerDevices(ctx context.Context, cr *c
221221

222222
// now we get the physical devices associated with PodID
223223
physicalDevices := sas.podDeviceIDMap[cr.PodID]
224-
for _, vid := range cr.VirtualDeviceID {
224+
for _, vid := range cr.VirtualDeviceIDs {
225225
if _, ok := sas.virtualDeviceIDMap[vid]; ok {
226226
err := fmt.Errorf("Virtual Device ID %s is already taken", vid)
227227
log.Print(err)
@@ -248,7 +248,8 @@ func (sas *SandboxAPIServer) AllocateContainerDevices(ctx context.Context, cr *c
248248
sas.containerDeviceIDMap[cr.ContainerID] = containerDevices
249249
sas.virtualDeviceIDMap[vid] = physDev
250250
sas.deviceVirtualIDMap[physDev] = vid
251-
response.PhysicalDeviceID = append(response.PhysicalDeviceID, devicePath)
251+
response.VirtualDeviceIDs = append(response.VirtualDeviceIDs, vid)
252+
response.PhysicalDeviceIDs = append(response.PhysicalDeviceIDs, devicePath)
252253
assigned = true
253254
break
254255
}
@@ -272,7 +273,7 @@ func (sas *SandboxAPIServer) FreeContainerDevices(ctx context.Context, cr *cdire
272273
physDev := sas.virtualDeviceIDMap[vid]
273274
delete(sas.virtualDeviceIDMap, vid)
274275
delete(sas.deviceVirtualIDMap, physDev)
275-
response.PhysicalDeviceID = append(response.PhysicalDeviceID, physDev)
276+
response.PhysicalDeviceIDs = append(response.PhysicalDeviceIDs, physDev)
276277
}
277278
delete(sas.containerDeviceIDMap, cr.ContainerID)
278279

@@ -294,12 +295,12 @@ func (sas *SandboxAPIServer) FreePodDevices(ctx context.Context, pr *cdiresolver
294295
log.Printf("[INFO] Free Pod Devices request: %v", pr)
295296
// remove all physical devices associated with pod
296297
response := &cdiresolver.PhysicalDeviceResponse{}
297-
response.PhysicalDeviceID = sas.podDeviceIDMap[pr.PodID]
298+
response.PhysicalDeviceIDs = sas.podDeviceIDMap[pr.PodID]
298299
delete(sas.podDeviceIDMap, pr.PodID)
299300

300301
// put the devices back into available device list for the given type
301302
deviceType := pr.DeviceType
302-
sas.deviceIDs[deviceType] = append(sas.deviceIDs[deviceType], response.PhysicalDeviceID...)
303+
sas.deviceIDs[deviceType] = append(sas.deviceIDs[deviceType], response.PhysicalDeviceIDs...)
303304

304305
// also double check and free the virtual device IDs associated with these physical devices
305306
// get containers for the pod:
@@ -317,7 +318,7 @@ func (sas *SandboxAPIServer) FreePodDevices(ctx context.Context, pr *cdiresolver
317318
// in case there is some physical device assigned to the pod
318319
// and mapped to a virtual device, but never had a container associated with it
319320
// we still need to clean it up
320-
for _, pdev := range response.PhysicalDeviceID {
321+
for _, pdev := range response.PhysicalDeviceIDs {
321322
delete(sas.deviceVirtualIDMap, pdev)
322323
}
323324

vendor/github.com/kata-containers/kata-containers/src/runtime/protocols/cdiresolver/cdiresolver.pb.go

Lines changed: 32 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/kata-containers/kata-containers/src/runtime/protocols/cdiresolver/cdiresolver.proto

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ github.com/google/pprof/profile
3131
# github.com/google/uuid v1.6.0
3232
## explicit
3333
github.com/google/uuid
34-
# github.com/kata-containers/kata-containers/src/runtime v0.0.0-20250925190653-d1f52728ccdf => github.com/jojimt/kata-containers/src/runtime v0.0.0-20250923214116-860bce0a244e
34+
# github.com/kata-containers/kata-containers/src/runtime v0.0.0-20251030104659-e30e2b5f4527 => github.com/jojimt/kata-containers/src/runtime v0.0.0-20251030193914-638e45702938
3535
## explicit; go 1.24.6
3636
github.com/kata-containers/kata-containers/src/runtime/protocols/cdiresolver
3737
# github.com/onsi/ginkgo/v2 v2.22.2
@@ -226,4 +226,4 @@ k8s.io/klog/v2/internal/sloghandler
226226
# k8s.io/kubelet v0.32.2
227227
## explicit; go 1.23.0
228228
k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1
229-
# github.com/kata-containers/kata-containers/src/runtime => github.com/jojimt/kata-containers/src/runtime v0.0.0-20250923214116-860bce0a244e
229+
# github.com/kata-containers/kata-containers/src/runtime => github.com/jojimt/kata-containers/src/runtime v0.0.0-20251030193914-638e45702938

0 commit comments

Comments
 (0)