mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Remove uint64 bitshift workaround
This commit is contained in:
parent
0968254840
commit
22eee15fe7
@ -40,10 +40,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs(
|
|||||||
},
|
},
|
||||||
func(j *internal.ObjectMeta, c fuzz.Continue) {
|
func(j *internal.ObjectMeta, c fuzz.Continue) {
|
||||||
j.Name = c.RandString()
|
j.Name = c.RandString()
|
||||||
// TODO: Fix JSON/YAML packages and/or write custom encoding
|
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
||||||
// 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.SelfLink = c.RandString()
|
j.SelfLink = c.RandString()
|
||||||
|
|
||||||
var sec, nsec int64
|
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()
|
j.CreationTimestamp = util.Unix(sec, nsec).Rfc3339Copy()
|
||||||
},
|
},
|
||||||
func(j *internal.ListMeta, c fuzz.Continue) {
|
func(j *internal.ListMeta, c fuzz.Continue) {
|
||||||
// TODO: Fix JSON/YAML packages and/or write custom encoding
|
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
||||||
// 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.SelfLink = c.RandString()
|
j.SelfLink = c.RandString()
|
||||||
},
|
},
|
||||||
func(j *internal.ObjectReference, c fuzz.Continue) {
|
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.Kind = c.RandString()
|
||||||
j.Namespace = c.RandString()
|
j.Namespace = c.RandString()
|
||||||
j.Name = c.RandString()
|
j.Name = c.RandString()
|
||||||
// TODO: Fix JSON/YAML packages and/or write custom encoding
|
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
||||||
// 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.FieldPath = c.RandString()
|
j.FieldPath = c.RandString()
|
||||||
},
|
},
|
||||||
func(j *internal.PodPhase, c fuzz.Continue) {
|
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()
|
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) {
|
func(pb map[docker.Port][]docker.PortBinding, c fuzz.Continue) {
|
||||||
// This is necessary because keys with nil values get omitted.
|
// This is necessary because keys with nil values get omitted.
|
||||||
// TODO: Is this a bug?
|
// TODO: Is this a bug?
|
||||||
|
@ -50,10 +50,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs(
|
|||||||
j.Kind = ""
|
j.Kind = ""
|
||||||
|
|
||||||
j.Name = c.RandString()
|
j.Name = c.RandString()
|
||||||
// TODO: Fix JSON/YAML packages and/or write custom encoding
|
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
||||||
// 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.SelfLink = c.RandString()
|
j.SelfLink = c.RandString()
|
||||||
|
|
||||||
var sec, nsec int64
|
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) {
|
func(j *api.ObjectMeta, c fuzz.Continue) {
|
||||||
j.Name = c.RandString()
|
j.Name = c.RandString()
|
||||||
// TODO: Fix JSON/YAML packages and/or write custom encoding
|
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
||||||
// 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.SelfLink = c.RandString()
|
j.SelfLink = c.RandString()
|
||||||
|
|
||||||
var sec, nsec int64
|
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()
|
j.CreationTimestamp = util.Unix(sec, nsec).Rfc3339Copy()
|
||||||
},
|
},
|
||||||
func(j *api.ListMeta, c fuzz.Continue) {
|
func(j *api.ListMeta, c fuzz.Continue) {
|
||||||
// TODO: Fix JSON/YAML packages and/or write custom encoding
|
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
||||||
// 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.SelfLink = c.RandString()
|
j.SelfLink = c.RandString()
|
||||||
},
|
},
|
||||||
func(j *api.PodPhase, c fuzz.Continue) {
|
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()
|
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) {
|
func(pb map[docker.Port][]docker.PortBinding, c fuzz.Continue) {
|
||||||
// This is necessary because keys with nil values get omitted.
|
// This is necessary because keys with nil values get omitted.
|
||||||
// TODO: Is this a bug?
|
// TODO: Is this a bug?
|
||||||
|
@ -51,10 +51,7 @@ var apiObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 1).Funcs(
|
|||||||
j.Kind = ""
|
j.Kind = ""
|
||||||
|
|
||||||
j.Name = c.RandString()
|
j.Name = c.RandString()
|
||||||
// TODO: Fix JSON/YAML packages and/or write custom encoding
|
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
||||||
// 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.SelfLink = c.RandString()
|
j.SelfLink = c.RandString()
|
||||||
|
|
||||||
var sec, nsec int64
|
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) {
|
func(j *api.ObjectMeta, c fuzz.Continue) {
|
||||||
j.Name = c.RandString()
|
j.Name = c.RandString()
|
||||||
// TODO: Fix JSON/YAML packages and/or write custom encoding
|
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
||||||
// 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.SelfLink = c.RandString()
|
j.SelfLink = c.RandString()
|
||||||
|
|
||||||
var sec, nsec int64
|
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()
|
j.CreationTimestamp = util.Unix(sec, nsec).Rfc3339Copy()
|
||||||
},
|
},
|
||||||
func(j *api.ListMeta, c fuzz.Continue) {
|
func(j *api.ListMeta, c fuzz.Continue) {
|
||||||
// TODO: Fix JSON/YAML packages and/or write custom encoding
|
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
|
||||||
// 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.SelfLink = c.RandString()
|
j.SelfLink = c.RandString()
|
||||||
},
|
},
|
||||||
func(j *api.PodPhase, c fuzz.Continue) {
|
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()
|
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) {
|
func(pb map[docker.Port][]docker.PortBinding, c fuzz.Continue) {
|
||||||
// This is necessary because keys with nil values get omitted.
|
// This is necessary because keys with nil values get omitted.
|
||||||
// TODO: Is this a bug?
|
// TODO: Is this a bug?
|
||||||
|
@ -104,18 +104,6 @@ var TestObjectFuzzer = fuzz.New().NilChance(.5).NumElements(1, 100).Funcs(
|
|||||||
j.ObjectKind = ""
|
j.ObjectKind = ""
|
||||||
j.ID = c.RandString()
|
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.
|
// Returns a new Scheme set up with the test objects.
|
||||||
|
Loading…
Reference in New Issue
Block a user