Skip to content

Commit ed22777

Browse files
authored
Merge pull request #47 from elezar/bump-0.3.0
@elezar thank you. Merging.
2 parents ee12044 + d96d442 commit ed22777

File tree

13 files changed

+94
-90
lines changed

13 files changed

+94
-90
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Additionally runtimes don't uniformly expose a plugin system (or even expose a p
2525
$ mkdir /etc/cdi
2626
$ cat > /etc/cdi/vendor.json <<EOF
2727
{
28-
"cdiVersion": "0.2.0",
28+
"cdiVersion": "0.3.0",
2929
"kind": "vendor.com/device",
3030
"devices": [
3131
{

SPEC.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88

99
## Version
1010

11-
This is CDI **spec** version **0.1.0**.
11+
This is CDI **spec** version **0.3.0**.
1212

1313
#### Released versions
1414

1515
Released versions of the spec are available as Git tags.
1616

1717
| Tag | Spec Permalink | Change |
1818
| -----| -----------------| -------|
19+
| v0.3.0 | | Initial tagged release of Spec |
1920

2021
## Overview
2122

@@ -68,9 +69,8 @@ The key words "must", "must not", "required", "shall", "shall not", "should", "s
6869

6970
```
7071
{
71-
"cdiVersion": "0.1.0",
72+
"cdiVersion": "0.3.0",
7273
"kind": "<name>",
73-
"containerRuntime": ["<container-runtime-name>"], (optional)
7474
7575
"devices": [
7676
{
@@ -97,7 +97,7 @@ The key words "must", "must not", "required", "shall", "shall not", "should", "s
9797
"major": <int32> (optional),
9898
"minor": <int32> (optional),
9999
// file mode for the device
100-
"fileMode": <int> (optional),
100+
"fileMode": <int> (optional),
101101
// Cgroups permissions of the device, candidates are one or more of
102102
// * r - allows container to read from the specified device.
103103
// * w - allows container to write to the specified device.
@@ -143,12 +143,6 @@ The key words "must", "must not", "required", "shall", "shall not", "should", "s
143143
* Valid: `vendor.com/foo`, `foo.bar.baz/foo-bar123.B_az`.
144144
* Invalid: `foo`, `vendor.com/foo/`, `vendor.com/foo/bar`.
145145

146-
#### Container Runtime
147-
148-
* `containerRuntime` (array of string, OPTIONAL) indicates that this CDI specification targets only a specific container runtime.
149-
If this field is indicated, the container runtime MUST use the one that matches its name if non exists it should use the one that does not indicate any `containerRuntime` value.
150-
Possible values (not an exhaustive list): docker, podman, gvisor, lxc
151-
152146
#### CDI Devices
153147

154148
The `devices` field describes the set of hardware devices that can be requested by the container runtime user.
@@ -203,8 +197,6 @@ The `containerEdits` field has the following definition:
203197
* `timeout` (int, OPTIONAL) is the number of seconds before aborting the hook. If set, timeout MUST be greater than zero. If not set container runtime will wait for the hook to return.
204198

205199
## Error Handling
206-
* Two or more files with identical `kind` values and identical `containerRuntime` field.
207-
Container runtimes should surface this error when any device with that `kind` is requested.
208200
* Kind requested is not present in any CDI file.
209201
Container runtimes should surface an error when a non existent kind is requested.
210202
* Device (not device node) Requested does not exist.

pkg/cdi/cache_test.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestNewCache(t *testing.T) {
4646
name: "one spec file",
4747
etc: map[string]string{
4848
"vendor1.yaml": `
49-
cdiVersion: "0.2.0"
49+
cdiVersion: "0.3.0"
5050
kind: "vendor1.com/device"
5151
devices:
5252
- name: "dev1"
@@ -66,7 +66,7 @@ devices:
6666
name: "multiple spec files with override",
6767
etc: map[string]string{
6868
"vendor1.yaml": `
69-
cdiVersion: "0.2.0"
69+
cdiVersion: "0.3.0"
7070
kind: "vendor1.com/device"
7171
devices:
7272
- name: "dev1"
@@ -87,7 +87,7 @@ devices:
8787
},
8888
run: map[string]string{
8989
"vendor1.yaml": `
90-
cdiVersion: "0.2.0"
90+
cdiVersion: "0.3.0"
9191
kind: "vendor1.com/device"
9292
devices:
9393
- name: "dev1"
@@ -108,7 +108,7 @@ devices:
108108
name: "multiple spec files, with conflicts",
109109
run: map[string]string{
110110
"vendor1.yaml": `
111-
cdiVersion: "0.2.0"
111+
cdiVersion: "0.3.0"
112112
kind: "vendor1.com/device"
113113
devices:
114114
- name: "dev1"
@@ -127,7 +127,7 @@ devices:
127127
minor: 2
128128
`,
129129
"vendor1-other.yaml": `
130-
cdiVersion: "0.2.0"
130+
cdiVersion: "0.3.0"
131131
kind: "vendor1.com/device"
132132
devices:
133133
- name: "dev1"
@@ -217,7 +217,7 @@ func TestRefreshCache(t *testing.T) {
217217
{
218218
run: map[string]string{
219219
"vendor1.yaml": `
220-
cdiVersion: "0.2.0"
220+
cdiVersion: "0.3.0"
221221
kind: "vendor1.com/device"
222222
devices:
223223
- name: "dev1"
@@ -254,7 +254,7 @@ devices:
254254
{
255255
etc: map[string]string{
256256
"vendor1.yaml": `
257-
cdiVersion: "0.2.0"
257+
cdiVersion: "0.3.0"
258258
kind: "vendor1.com/device"
259259
devices:
260260
- name: "dev1"
@@ -270,7 +270,7 @@ devices:
270270
{
271271
run: map[string]string{
272272
"vendor1.yaml": `
273-
cdiVersion: "0.2.0"
273+
cdiVersion: "0.3.0"
274274
kind: "vendor1.com/device"
275275
devices:
276276
- name: "dev2"
@@ -313,7 +313,7 @@ devices:
313313
{
314314
run: map[string]string{
315315
"vendor1.yaml": `
316-
cdiVersion: "0.2.0"
316+
cdiVersion: "0.3.0"
317317
kind: "vendor1.com/device"
318318
devices:
319319
- name: "dev1"
@@ -325,7 +325,7 @@ devices:
325325
minor: 1
326326
`,
327327
"vendor1-other.yaml": `
328-
cdiVersion: "0.2.0"
328+
cdiVersion: "0.3.0"
329329
kind: "vendor1.com/device"
330330
devices:
331331
- name: "dev2"
@@ -373,7 +373,7 @@ devices:
373373
{
374374
etc: map[string]string{
375375
"vendor1.yaml": `
376-
cdiVersion: "0.2.0"
376+
cdiVersion: "0.3.0"
377377
kind: "vendor1.com/device"
378378
devices:
379379
- name: "dev1"
@@ -389,7 +389,7 @@ devices:
389389
{
390390
run: map[string]string{
391391
"vendor1.yaml": `
392-
cdiVersion: "0.2.0"
392+
cdiVersion: "0.3.0"
393393
kind: "vendor1.com/device"
394394
devices:
395395
- name: "dev1"
@@ -430,7 +430,7 @@ devices:
430430
{
431431
run: map[string]string{
432432
"vendor1.yaml": `
433-
cdiVersion: "0.2.0"
433+
cdiVersion: "0.3.0"
434434
kind: "vendor1.com/device"
435435
devices:
436436
- name: "dev1"
@@ -453,7 +453,7 @@ devices:
453453
{
454454
run: map[string]string{
455455
"vendor1-other.yaml": `
456-
cdiVersion: "0.2.0"
456+
cdiVersion: "0.3.0"
457457
kind: "vendor1.com/device"
458458
devices:
459459
- name: "dev1"
@@ -583,7 +583,7 @@ func TestInjectDevice(t *testing.T) {
583583
cdiSpecs: specDirs{
584584
etc: map[string]string{
585585
"vendor1.yaml": `
586-
cdiVersion: "0.2.0"
586+
cdiVersion: "0.3.0"
587587
kind: "vendor1.com/device"
588588
containerEdits:
589589
env:
@@ -640,7 +640,7 @@ devices:
640640
cdiSpecs: specDirs{
641641
etc: map[string]string{
642642
"vendor1.yaml": `
643-
cdiVersion: "0.2.0"
643+
cdiVersion: "0.3.0"
644644
kind: "vendor1.com/device"
645645
containerEdits:
646646
env:
@@ -722,7 +722,7 @@ devices:
722722
cdiSpecs: specDirs{
723723
etc: map[string]string{
724724
"vendor1.yaml": `
725-
cdiVersion: "0.2.0"
725+
cdiVersion: "0.3.0"
726726
kind: "vendor1.com/device"
727727
containerEdits:
728728
env:
@@ -881,7 +881,7 @@ devices:
881881
cdiSpecs: specDirs{
882882
etc: map[string]string{
883883
"vendor1.yaml": `
884-
cdiVersion: "0.2.0"
884+
cdiVersion: "0.3.0"
885885
kind: "vendor1.com/device"
886886
containerEdits:
887887
env:
@@ -962,7 +962,7 @@ func TestListVendorsAndClasses(t *testing.T) {
962962
cdiSpecs: specDirs{
963963
etc: map[string]string{
964964
"vendor1.yaml": `
965-
cdiVersion: "0.2.0"
965+
cdiVersion: "0.3.0"
966966
kind: "vendor1.com/device"
967967
containerEdits:
968968
env:
@@ -992,7 +992,7 @@ devices:
992992
cdiSpecs: specDirs{
993993
etc: map[string]string{
994994
"vendor1.yaml": `
995-
cdiVersion: "0.2.0"
995+
cdiVersion: "0.3.0"
996996
kind: "vendor1.com/device"
997997
containerEdits:
998998
devices:
@@ -1014,7 +1014,7 @@ devices:
10141014
minor: 2
10151015
`,
10161016
"vendor1-other.yaml": `
1017-
cdiVersion: "0.2.0"
1017+
cdiVersion: "0.3.0"
10181018
kind: "vendor1.com/other-device"
10191019
containerEdits:
10201020
devices:
@@ -1050,7 +1050,7 @@ devices:
10501050
cdiSpecs: specDirs{
10511051
etc: map[string]string{
10521052
"vendor1.yaml": `
1053-
cdiVersion: "0.2.0"
1053+
cdiVersion: "0.3.0"
10541054
kind: "vendor1.com/device"
10551055
containerEdits:
10561056
devices:
@@ -1072,7 +1072,7 @@ devices:
10721072
minor: 2
10731073
`,
10741074
"vendor2.yaml": `
1075-
cdiVersion: "0.2.0"
1075+
cdiVersion: "0.3.0"
10761076
kind: "vendor2.com/other-device"
10771077
containerEdits:
10781078
devices:
@@ -1092,7 +1092,7 @@ devices:
10921092
minor: 2
10931093
`,
10941094
"vendor2-other.yaml": `
1095-
cdiVersion: "0.2.0"
1095+
cdiVersion: "0.3.0"
10961096
kind: "vendor2.com/another-device"
10971097
containerEdits:
10981098
devices:
@@ -1112,7 +1112,7 @@ devices:
11121112
minor: 2
11131113
`,
11141114
"vendor3.yaml": `
1115-
cdiVersion: "0.2.0"
1115+
cdiVersion: "0.3.0"
11161116
kind: "vendor3.com/yet-another-device"
11171117
containerEdits:
11181118
devices:

0 commit comments

Comments
 (0)