@@ -25,7 +25,7 @@ import (
25
25
26
26
const (
27
27
// CurrentVersion is the current version of the Spec.
28
- CurrentVersion = "1.0 .0"
28
+ CurrentVersion = "1.1 .0"
29
29
30
30
// vCurrent is the current version as a semver-comparable type
31
31
vCurrent version = "v" + CurrentVersion
@@ -40,6 +40,7 @@ const (
40
40
v070 version = "v0.7.0"
41
41
v080 version = "v0.8.0"
42
42
v100 version = "v1.0.0"
43
+ v110 version = "v1.1.0"
43
44
44
45
// vEarliest is the earliest supported version of the CDI specification
45
46
vEarliest version = v030
@@ -58,6 +59,7 @@ var validSpecVersions = requiredVersionMap{
58
59
v070 : requiresV070 ,
59
60
v080 : requiresV080 ,
60
61
v100 : requiresV100 ,
62
+ v110 : requiresV110 ,
61
63
}
62
64
63
65
// ValidateVersion checks whether the specified spec version is valid.
@@ -140,6 +142,20 @@ func (r requiredVersionMap) requiredVersion(spec *Spec) version {
140
142
return minVersion
141
143
}
142
144
145
+ // requiresV110 returns true if the spec uses v1.1.0 features.
146
+ // NetDevices was added after v1.0.0 so it presence requires v1.1.0.
147
+ func requiresV110 (spec * Spec ) bool {
148
+ if spec .ContainerEdits .NetDevices != nil {
149
+ return true
150
+ }
151
+ for _ , dev := range spec .Devices {
152
+ if dev .ContainerEdits .NetDevices != nil {
153
+ return true
154
+ }
155
+ }
156
+ return false
157
+ }
158
+
143
159
// requiresV100 returns true if the spec uses v1.0.0 features.
144
160
// Since the v1.0.0 spec bump was due to moving the minimum version checks to
145
161
// the spec package, there are no explicit spec changes.
0 commit comments