@@ -17,6 +17,7 @@ import (
17
17
18
18
osapi "github.com/openshift/origin/pkg/api"
19
19
_ "github.com/openshift/origin/pkg/api/latest"
20
+ "github.com/openshift/origin/pkg/api/v1"
20
21
"github.com/openshift/origin/pkg/api/v1beta1"
21
22
"github.com/openshift/origin/pkg/api/v1beta3"
22
23
authorizationapi "github.com/openshift/origin/pkg/authorization/api"
@@ -53,13 +54,13 @@ func fuzzInternalObject(t *testing.T, forVersion string, item runtime.Object, se
53
54
},
54
55
func (j * image.ImageRepositoryMapping , c fuzz.Continue ) {
55
56
c .FuzzNoCustom (j )
56
- if forVersion == "v1beta3 " {
57
+ if forVersion != "v1beta1 " {
57
58
j .DockerImageRepository = ""
58
59
}
59
60
},
60
61
func (j * image.ImageStreamMapping , c fuzz.Continue ) {
61
62
c .FuzzNoCustom (j )
62
- if forVersion == "v1beta3 " {
63
+ if forVersion != "v1beta1 " {
63
64
j .DockerImageRepository = ""
64
65
}
65
66
},
@@ -108,7 +109,7 @@ func fuzzInternalObject(t *testing.T, forVersion string, item runtime.Object, se
108
109
c .FuzzNoCustom (j )
109
110
specs := []string {"" , "a/b" , "a/b/c" , "a:5000/b/c" , "a/b:latest" , "a/b@test" }
110
111
j .DockerImageReference = specs [c .Intn (len (specs ))]
111
- if forVersion == "v1beta3 " {
112
+ if forVersion != "v1beta1 " {
112
113
j .Tag , j .DockerImageReference = "" , ""
113
114
if j .To != nil && (len (j .To .Kind ) == 0 || j .To .Kind == "ImageStream" ) {
114
115
j .To .Kind = "ImageStream"
@@ -255,7 +256,10 @@ var skipStandardVersions = map[string][]string{
255
256
"DockerImage" : {"pre012" , "1.0" },
256
257
}
257
258
var skipV1beta1 = map [string ]struct {}{}
258
- var skipV1beta2 = map [string ]struct {}{
259
+ var skipV1beta3 = map [string ]struct {}{
260
+ "ImageRepository" : {},
261
+ }
262
+ var skipV1 = map [string ]struct {}{
259
263
"ImageRepository" : {},
260
264
}
261
265
@@ -277,6 +281,7 @@ func TestSpecificKind(t *testing.T) {
277
281
roundTrip (t , osapi .Codec , item )
278
282
roundTrip (t , v1beta1 .Codec , item )
279
283
roundTrip (t , v1beta3 .Codec , item )
284
+ roundTrip (t , v1 .Codec , item )
280
285
}
281
286
282
287
func TestTypes (t * testing.T ) {
@@ -310,10 +315,14 @@ func TestTypes(t *testing.T) {
310
315
fuzzInternalObject (t , "v1beta1" , item , seed )
311
316
roundTrip (t , v1beta1 .Codec , item )
312
317
}
313
- if _ , ok := skipV1beta2 [kind ]; ! ok {
318
+ if _ , ok := skipV1beta3 [kind ]; ! ok {
314
319
fuzzInternalObject (t , "v1beta3" , item , seed )
315
320
roundTrip (t , v1beta3 .Codec , item )
316
321
}
322
+ if _ , ok := skipV1 [kind ]; ! ok {
323
+ fuzzInternalObject (t , "v1" , item , seed )
324
+ roundTrip (t , v1 .Codec , item )
325
+ }
317
326
}
318
327
}
319
328
}
0 commit comments