@@ -141,7 +141,7 @@ func SetDefaults_Pod(obj *v1.Pod) {
141
141
}
142
142
for key , value := range obj .Spec .Containers [i ].Resources .Limits {
143
143
if _ , exists := obj .Spec .Containers [i ].Resources .Requests [key ]; ! exists {
144
- obj .Spec .Containers [i ].Resources .Requests [key ] = * ( value .Copy () )
144
+ obj .Spec .Containers [i ].Resources .Requests [key ] = value .DeepCopy ( )
145
145
}
146
146
}
147
147
}
@@ -153,7 +153,7 @@ func SetDefaults_Pod(obj *v1.Pod) {
153
153
}
154
154
for key , value := range obj .Spec .InitContainers [i ].Resources .Limits {
155
155
if _ , exists := obj .Spec .InitContainers [i ].Resources .Requests [key ]; ! exists {
156
- obj .Spec .InitContainers [i ].Resources .Requests [key ] = * ( value .Copy () )
156
+ obj .Spec .InitContainers [i ].Resources .Requests [key ] = value .DeepCopy ( )
157
157
}
158
158
}
159
159
}
@@ -315,7 +315,7 @@ func SetDefaults_NodeStatus(obj *v1.NodeStatus) {
315
315
if obj .Allocatable == nil && obj .Capacity != nil {
316
316
obj .Allocatable = make (v1.ResourceList , len (obj .Capacity ))
317
317
for key , value := range obj .Capacity {
318
- obj .Allocatable [key ] = * ( value .Copy () )
318
+ obj .Allocatable [key ] = value .DeepCopy ( )
319
319
}
320
320
obj .Allocatable = obj .Capacity
321
321
}
@@ -339,19 +339,19 @@ func SetDefaults_LimitRangeItem(obj *v1.LimitRangeItem) {
339
339
// If a default limit is unspecified, but the max is specified, default the limit to the max
340
340
for key , value := range obj .Max {
341
341
if _ , exists := obj .Default [key ]; ! exists {
342
- obj .Default [key ] = * ( value .Copy () )
342
+ obj .Default [key ] = value .DeepCopy ( )
343
343
}
344
344
}
345
345
// If a default limit is specified, but the default request is not, default request to limit
346
346
for key , value := range obj .Default {
347
347
if _ , exists := obj .DefaultRequest [key ]; ! exists {
348
- obj .DefaultRequest [key ] = * ( value .Copy () )
348
+ obj .DefaultRequest [key ] = value .DeepCopy ( )
349
349
}
350
350
}
351
351
// If a default request is not specified, but the min is provided, default request to the min
352
352
for key , value := range obj .Min {
353
353
if _ , exists := obj .DefaultRequest [key ]; ! exists {
354
- obj .DefaultRequest [key ] = * ( value .Copy () )
354
+ obj .DefaultRequest [key ] = value .DeepCopy ( )
355
355
}
356
356
}
357
357
}
0 commit comments