File tree Expand file tree Collapse file tree 2 files changed +6
-48
lines changed Expand file tree Collapse file tree 2 files changed +6
-48
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -183,23 +183,20 @@ func requiresV060(spec *Spec) bool {
183
183
}
184
184
185
185
// The v0.6.0 spec allows dots "." in Kind name label (class)
186
- vendor , class := parseQualifier (spec .Kind )
187
- if vendor != "" {
188
- if strings .ContainsRune (class , '.' ) {
189
- return true
190
- }
186
+ if ! strings .Contains (spec .Kind , "/" ) {
187
+ return false
191
188
}
192
-
193
- return false
189
+ class := strings . SplitN ( spec . Kind , "/" , 2 )[ 1 ]
190
+ return strings . Contains ( class , "." )
194
191
}
195
192
196
193
// requiresV050 returns true if the spec uses v0.5.0 features
197
194
func requiresV050 (spec * Spec ) bool {
198
195
var edits []* ContainerEdits
199
196
200
197
for _ , d := range spec .Devices {
201
- // The v0.5.0 spec allowed device names to start with a digit instead of requiring a letter
202
- if len (d .Name ) > 0 && ! isLetter ( rune ( d .Name [0 ])) {
198
+ // The v0.5.0 spec allowed device name to start with a digit
199
+ if len (d .Name ) > 0 && '0' <= d .Name [0 ] && d . Name [ 0 ] <= '9' {
203
200
return true
204
201
}
205
202
edits = append (edits , & d .ContainerEdits )
You can’t perform that action at this time.
0 commit comments