Move extract resources to its pkg

Move ExtractContainerResourceValue
This commit is contained in:
Harry Zhang
2017-02-07 22:19:49 +08:00
parent 81545c2922
commit efb10b1821
11 changed files with 252 additions and 262 deletions

View File

@@ -648,9 +648,9 @@ func (kl *Kubelet) podFieldSelectorRuntimeValue(fs *v1.ObjectFieldSelector, pod
func containerResourceRuntimeValue(fs *v1.ResourceFieldSelector, pod *v1.Pod, container *v1.Container) (string, error) {
containerName := fs.ContainerName
if len(containerName) == 0 {
return fieldpath.ExtractContainerResourceValue(fs, container)
return v1.ExtractContainerResourceValue(fs, container)
} else {
return fieldpath.ExtractResourceValueByContainerName(fs, pod, containerName)
return v1.ExtractResourceValueByContainerName(fs, pod, containerName)
}
}