Copy docker client structs, adding yaml/json tags.

Use these in our v1beta1 package so that we can pass fuzz test encode/decode.
This commit is contained in:
Daniel Smith
2014-07-29 18:06:25 -07:00
parent 30b6ab5278
commit 828aed4cc8
4 changed files with 136 additions and 17 deletions

View File

@@ -109,7 +109,7 @@ func (f *Fuzzer) doFuzz(v reflect.Value) {
case reflect.Map:
if rand.Intn(5) > 0 {
v.Set(reflect.MakeMap(v.Type()))
n := 1 + rand.Intn(10)
n := 1 + rand.Intn(2)
for i := 0; i < n; i++ {
key := reflect.New(v.Type().Key()).Elem()
f.doFuzz(key)
@@ -129,7 +129,7 @@ func (f *Fuzzer) doFuzz(v reflect.Value) {
v.Set(reflect.Zero(v.Type()))
case reflect.Slice:
if rand.Intn(5) > 0 {
n := 1 + rand.Intn(10)
n := 1 + rand.Intn(2)
v.Set(reflect.MakeSlice(v.Type(), n, n))
for i := 0; i < n; i++ {
f.doFuzz(v.Index(i))