apimachinery: remove Scheme.DeepCopy
This commit is contained in:
@@ -22,7 +22,6 @@ import (
|
||||
"github.com/golang/glog"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
"k8s.io/kubernetes/pkg/api/v1/resource"
|
||||
)
|
||||
|
||||
@@ -51,15 +50,7 @@ func (kl *Kubelet) defaultPodLimitsForDownwardAPI(pod *v1.Pod, container *v1.Con
|
||||
|
||||
var outputContainer *v1.Container
|
||||
if container != nil {
|
||||
containerCopy, err := scheme.Scheme.DeepCopy(container)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to perform a deep copy of container object: %v", err)
|
||||
}
|
||||
var ok bool
|
||||
outputContainer, ok = containerCopy.(*v1.Container)
|
||||
if !ok {
|
||||
return nil, nil, fmt.Errorf("unexpected type returned from deep copy of container object")
|
||||
}
|
||||
outputContainer = container.DeepCopy()
|
||||
resource.MergeContainerResourceLimits(outputContainer, allocatable)
|
||||
}
|
||||
return outputPod, outputContainer, nil
|
||||
|
Reference in New Issue
Block a user