@@ -25,7 +25,7 @@ import (
2525
2626const  (
2727	// CurrentVersion is the current version of the Spec. 
28- 	CurrentVersion  =  "1.0 .0" 
28+ 	CurrentVersion  =  "1.1 .0" 
2929
3030	// vCurrent is the current version as a semver-comparable type 
3131	vCurrent  version  =  "v"  +  CurrentVersion 
@@ -40,6 +40,7 @@ const (
4040	v070  version  =  "v0.7.0" 
4141	v080  version  =  "v0.8.0" 
4242	v100  version  =  "v1.0.0" 
43+ 	v110  version  =  "v1.1.0" 
4344
4445	// vEarliest is the earliest supported version of the CDI specification 
4546	vEarliest  version  =  v030 
@@ -58,6 +59,7 @@ var validSpecVersions = requiredVersionMap{
5859	v070 : requiresV070 ,
5960	v080 : requiresV080 ,
6061	v100 : requiresV100 ,
62+ 	v110 : requiresV110 ,
6163}
6264
6365// ValidateVersion checks whether the specified spec version is valid. 
@@ -140,6 +142,20 @@ func (r requiredVersionMap) requiredVersion(spec *Spec) version {
140142	return  minVersion 
141143}
142144
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  len (spec .ContainerEdits .NetDevices ) !=  0  {
149+ 		return  true 
150+ 	}
151+ 	for  _ , dev  :=  range  spec .Devices  {
152+ 		if  len (dev .ContainerEdits .NetDevices ) !=  0  {
153+ 			return  true 
154+ 		}
155+ 	}
156+ 	return  false 
157+ }
158+ 
143159// requiresV100 returns true if the spec uses v1.0.0 features. 
144160// Since the v1.0.0 spec bump was due to moving the minimum version checks to 
145161// the spec package, there are no explicit spec changes. 
0 commit comments