Merge pull request #7403 from vmarmol/rkt-deps

Remove DockerPrefix references in Kubelet.
This commit is contained in:
Dawn Chen
2015-04-27 19:05:43 -07:00
2 changed files with 15 additions and 3 deletions

View File

@@ -17,6 +17,8 @@ limitations under the License.
package container
import (
"strings"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/probe"
)
@@ -37,3 +39,14 @@ type Prober interface {
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 {
const prefixSeparator = "://"
idx := strings.Index(img, prefixSeparator)
if idx < 0 {
return img
}
return img[idx+len(prefixSeparator):]
}