File tree 1 file changed +14
-1
lines changed
cmd/dra-example-kubeletplugin
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
21
21
"os"
22
22
23
23
resourceapi "k8s.io/api/resource/v1alpha3"
24
+ "k8s.io/apimachinery/pkg/api/resource"
24
25
"k8s.io/utils/ptr"
25
26
26
27
"github.com/google/uuid"
@@ -32,14 +33,26 @@ func enumerateAllPossibleDevices() (AllocatableDevices, error) {
32
33
uuids := generateUUIDs (seed , numGPUs )
33
34
34
35
alldevices := make (AllocatableDevices )
35
- for _ , uuid := range uuids {
36
+ for i , uuid := range uuids {
36
37
device := resourceapi.Device {
37
38
Name : uuid ,
38
39
Basic : & resourceapi.BasicDevice {
39
40
Attributes : map [resourceapi.QualifiedName ]resourceapi.DeviceAttribute {
41
+ "index" : {
42
+ IntValue : ptr .To (int64 (i )),
43
+ },
44
+ "uuid" : {
45
+ StringValue : ptr .To (uuid ),
46
+ },
40
47
"model" : {
41
48
StringValue : ptr .To ("LATEST-GPU-MODEL" ),
42
49
},
50
+ "driverVersion" : {
51
+ VersionValue : ptr .To ("1.0.0" ),
52
+ },
53
+ },
54
+ Capacity : map [resourceapi.QualifiedName ]resource.Quantity {
55
+ "memory" : resource .MustParse ("80Gi" ),
43
56
},
44
57
},
45
58
}
You can’t perform that action at this time.
0 commit comments