diff --git a/pkg/api/latest/latest_test.go b/pkg/api/latest/latest_test.go index 3f2b2c309b5..f484fadcff6 100644 --- a/pkg/api/latest/latest_test.go +++ b/pkg/api/latest/latest_test.go @@ -40,10 +40,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( }, func(j *internal.ObjectMeta, c fuzz.Continue) { j.Name = c.RandString() - // TODO: Fix JSON/YAML packages and/or write custom encoding - // for uint64's. Somehow the LS *byte* of this is lost, but - // only when all 8 bytes are set. - j.ResourceVersion = strconv.FormatUint(c.RandUint64()>>8, 10) + j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.SelfLink = c.RandString() var sec, nsec int64 @@ -52,10 +49,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( j.CreationTimestamp = util.Unix(sec, nsec).Rfc3339Copy() }, func(j *internal.ListMeta, c fuzz.Continue) { - // TODO: Fix JSON/YAML packages and/or write custom encoding - // for uint64's. Somehow the LS *byte* of this is lost, but - // only when all 8 bytes are set. - j.ResourceVersion = strconv.FormatUint(c.RandUint64()>>8, 10) + j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.SelfLink = c.RandString() }, func(j *internal.ObjectReference, c fuzz.Continue) { @@ -65,10 +59,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( j.Kind = c.RandString() j.Namespace = c.RandString() j.Name = c.RandString() - // TODO: Fix JSON/YAML packages and/or write custom encoding - // for uint64's. Somehow the LS *byte* of this is lost, but - // only when all 8 bytes are set. - j.ResourceVersion = strconv.FormatUint(c.RandUint64()>>8, 10) + j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.FieldPath = c.RandString() }, func(j *internal.PodPhase, c fuzz.Continue) { @@ -104,10 +95,6 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( intstr.StrVal = c.RandString() } }, - func(u64 *uint64, c fuzz.Continue) { - // TODO: uint64's are NOT handled right. - *u64 = c.RandUint64() >> 8 - }, func(pb map[docker.Port][]docker.PortBinding, c fuzz.Continue) { // This is necessary because keys with nil values get omitted. // TODO: Is this a bug? diff --git a/pkg/api/serialization_test.go b/pkg/api/serialization_test.go index 3a36a1816b8..ddd32ac0097 100644 --- a/pkg/api/serialization_test.go +++ b/pkg/api/serialization_test.go @@ -50,10 +50,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( j.Kind = "" j.Name = c.RandString() - // TODO: Fix JSON/YAML packages and/or write custom encoding - // for uint64's. Somehow the LS *byte* of this is lost, but - // only when all 8 bytes are set. - j.ResourceVersion = strconv.FormatUint(c.RandUint64()>>8, 10) + j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.SelfLink = c.RandString() var sec, nsec int64 @@ -69,10 +66,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( }, func(j *api.ObjectMeta, c fuzz.Continue) { j.Name = c.RandString() - // TODO: Fix JSON/YAML packages and/or write custom encoding - // for uint64's. Somehow the LS *byte* of this is lost, but - // only when all 8 bytes are set. - j.ResourceVersion = strconv.FormatUint(c.RandUint64()>>8, 10) + j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.SelfLink = c.RandString() var sec, nsec int64 @@ -81,10 +75,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( j.CreationTimestamp = util.Unix(sec, nsec).Rfc3339Copy() }, func(j *api.ListMeta, c fuzz.Continue) { - // TODO: Fix JSON/YAML packages and/or write custom encoding - // for uint64's. Somehow the LS *byte* of this is lost, but - // only when all 8 bytes are set. - j.ResourceVersion = strconv.FormatUint(c.RandUint64()>>8, 10) + j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.SelfLink = c.RandString() }, func(j *api.PodPhase, c fuzz.Continue) { @@ -120,10 +111,6 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( intstr.StrVal = c.RandString() } }, - func(u64 *uint64, c fuzz.Continue) { - // TODO: uint64's are NOT handled right. - *u64 = c.RandUint64() >> 8 - }, func(pb map[docker.Port][]docker.PortBinding, c fuzz.Continue) { // This is necessary because keys with nil values get omitted. // TODO: Is this a bug? diff --git a/pkg/api/validation/schema_test.go b/pkg/api/validation/schema_test.go index 446a4a38db2..34a0cf3559c 100644 --- a/pkg/api/validation/schema_test.go +++ b/pkg/api/validation/schema_test.go @@ -51,10 +51,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( j.Kind = "" j.Name = c.RandString() - // TODO: Fix JSON/YAML packages and/or write custom encoding - // for uint64's. Somehow the LS *byte* of this is lost, but - // only when all 8 bytes are set. - j.ResourceVersion = strconv.FormatUint(c.RandUint64()>>8, 10) + j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.SelfLink = c.RandString() var sec, nsec int64 @@ -70,10 +67,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( }, func(j *api.ObjectMeta, c fuzz.Continue) { j.Name = c.RandString() - // TODO: Fix JSON/YAML packages and/or write custom encoding - // for uint64's. Somehow the LS *byte* of this is lost, but - // only when all 8 bytes are set. - j.ResourceVersion = strconv.FormatUint(c.RandUint64()>>8, 10) + j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.SelfLink = c.RandString() var sec, nsec int64 @@ -82,10 +76,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( j.CreationTimestamp = util.Unix(sec, nsec).Rfc3339Copy() }, func(j *api.ListMeta, c fuzz.Continue) { - // TODO: Fix JSON/YAML packages and/or write custom encoding - // for uint64's. Somehow the LS *byte* of this is lost, but - // only when all 8 bytes are set. - j.ResourceVersion = strconv.FormatUint(c.RandUint64()>>8, 10) + j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.SelfLink = c.RandString() }, func(j *api.PodPhase, c fuzz.Continue) { @@ -121,10 +112,6 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs( intstr.StrVal = c.RandString() } }, - func(u64 *uint64, c fuzz.Continue) { - // TODO: uint64's are NOT handled right. - *u64 = c.RandUint64() >> 8 - }, func(pb map[docker.Port][]docker.PortBinding, c fuzz.Continue) { // This is necessary because keys with nil values get omitted. // TODO: Is this a bug? diff --git a/pkg/conversion/scheme_test.go b/pkg/conversion/scheme_test.go index 146afd0587f..b9a38bfa37a 100644 --- a/pkg/conversion/scheme_test.go +++ b/pkg/conversion/scheme_test.go @@ -104,18 +104,6 @@ var TestObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 100).Funcs( j.ObjectKind = "" j.ID = c.RandString() }, - func(u *uint64, c fuzz.Continue) { - // TODO: Fix JSON/YAML packages and/or write custom encoding - // for uint64's. Somehow the LS *byte* of this is lost, but - // only when all 8 bytes are set. - *u = c.RandUint64() >> 8 - }, - func(u *uint, c fuzz.Continue) { - // TODO: Fix JSON/YAML packages and/or write custom encoding - // for uint64's. Somehow the LS *byte* of this is lost, but - // only when all 8 bytes are set. - *u = uint(c.RandUint64() >> 8) - }, ) // Returns a new Scheme set up with the test objects.