Delete duplicate resource.Quantity.Copy()

This commit is contained in:
Tim Allclair
2019-08-19 17:23:14 -07:00
parent f4521bf5a2
commit 49f50484b8
20 changed files with 88 additions and 106 deletions

View File

@@ -133,14 +133,14 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
q.Limits = make(core.ResourceList)
q.Requests = make(core.ResourceList)
cpuLimit := randomQuantity()
q.Limits[core.ResourceCPU] = *cpuLimit.Copy()
q.Requests[core.ResourceCPU] = *cpuLimit.Copy()
q.Limits[core.ResourceCPU] = cpuLimit.DeepCopy()
q.Requests[core.ResourceCPU] = cpuLimit.DeepCopy()
memoryLimit := randomQuantity()
q.Limits[core.ResourceMemory] = *memoryLimit.Copy()
q.Requests[core.ResourceMemory] = *memoryLimit.Copy()
q.Limits[core.ResourceMemory] = memoryLimit.DeepCopy()
q.Requests[core.ResourceMemory] = memoryLimit.DeepCopy()
storageLimit := randomQuantity()
q.Limits[core.ResourceStorage] = *storageLimit.Copy()
q.Requests[core.ResourceStorage] = *storageLimit.Copy()
q.Limits[core.ResourceStorage] = storageLimit.DeepCopy()
q.Requests[core.ResourceStorage] = storageLimit.DeepCopy()
},
func(q *core.LimitRangeItem, c fuzz.Continue) {
var cpuLimit resource.Quantity
@@ -148,16 +148,16 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
q.Type = core.LimitTypeContainer
q.Default = make(core.ResourceList)
q.Default[core.ResourceCPU] = *(cpuLimit.Copy())
q.Default[core.ResourceCPU] = cpuLimit.DeepCopy()
q.DefaultRequest = make(core.ResourceList)
q.DefaultRequest[core.ResourceCPU] = *(cpuLimit.Copy())
q.DefaultRequest[core.ResourceCPU] = cpuLimit.DeepCopy()
q.Max = make(core.ResourceList)
q.Max[core.ResourceCPU] = *(cpuLimit.Copy())
q.Max[core.ResourceCPU] = cpuLimit.DeepCopy()
q.Min = make(core.ResourceList)
q.Min[core.ResourceCPU] = *(cpuLimit.Copy())
q.Min[core.ResourceCPU] = cpuLimit.DeepCopy()
q.MaxLimitRequestRatio = make(core.ResourceList)
q.MaxLimitRequestRatio[core.ResourceCPU] = resource.MustParse("10")