mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 06:01:50 +00:00
Merge pull request #7586 from yujuhong/container_info
Remove more docker references in kubelet
This commit is contained in:
@@ -34,13 +34,13 @@ type RunContainerOptionsGenerator interface {
|
||||
GenerateRunContainerOptions(pod *api.Pod, container *api.Container, netMode, ipcMode string) (*RunContainerOptions, error)
|
||||
}
|
||||
|
||||
// Trims runtime prefix from image name (e.g.: docker://busybox -> busybox).
|
||||
func TrimRuntimePrefixFromImage(img string) string {
|
||||
// Trims runtime prefix from ID or image name (e.g.: docker://busybox -> busybox).
|
||||
func TrimRuntimePrefix(fullString string) string {
|
||||
const prefixSeparator = "://"
|
||||
|
||||
idx := strings.Index(img, prefixSeparator)
|
||||
idx := strings.Index(fullString, prefixSeparator)
|
||||
if idx < 0 {
|
||||
return img
|
||||
return fullString
|
||||
}
|
||||
return img[idx+len(prefixSeparator):]
|
||||
return fullString[idx+len(prefixSeparator):]
|
||||
}
|
||||
|
Reference in New Issue
Block a user