pkg/api: simplify deepcopy calls

This commit is contained in:
Dr. Stefan Schimanski
2017-08-15 14:16:45 +02:00
parent ce55939465
commit 362439db64
4 changed files with 7 additions and 35 deletions

View File

@@ -123,15 +123,7 @@ func ExtractResourceValueByContainerNameAndNodeAllocatable(copier deepCopier, fs
return "", err
}
containerCopy, err := copier.DeepCopy(realContainer)
if err != nil {
return "", fmt.Errorf("failed to perform a deep copy of container object: %v", err)
}
container, ok := containerCopy.(*v1.Container)
if !ok {
return "", fmt.Errorf("unexpected type returned from deep copy of container object")
}
container := realContainer.DeepCopy()
MergeContainerResourceLimits(container, nodeAllocatable)