mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #540 from vmarmol/always-latest
If no tag was specified, pull "latest" explicitly.
This commit is contained in:
commit
2f73b87e8a
@ -65,6 +65,12 @@ func NewDockerPuller(client DockerInterface) DockerPuller {
|
|||||||
|
|
||||||
func (p dockerPuller) Pull(image string) error {
|
func (p dockerPuller) Pull(image string) error {
|
||||||
image, tag := parseImageName(image)
|
image, tag := parseImageName(image)
|
||||||
|
|
||||||
|
// If no tag was specified, use the default "latest".
|
||||||
|
if len(tag) == 0 {
|
||||||
|
tag = "latest"
|
||||||
|
}
|
||||||
|
|
||||||
opts := docker.PullImageOptions{
|
opts := docker.PullImageOptions{
|
||||||
Repository: image,
|
Repository: image,
|
||||||
Tag: tag,
|
Tag: tag,
|
||||||
@ -194,7 +200,7 @@ func parseDockerName(name string) (manifestID, containerName string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses image name including an tag and returns image name and tag
|
// Parses image name including a tag and returns image name and tag.
|
||||||
// TODO: Future Docker versions can parse the tag on daemon side, see:
|
// TODO: Future Docker versions can parse the tag on daemon side, see:
|
||||||
// https://github.com/dotcloud/docker/issues/6876
|
// https://github.com/dotcloud/docker/issues/6876
|
||||||
// So this can be deprecated at some point.
|
// So this can be deprecated at some point.
|
||||||
|
Loading…
Reference in New Issue
Block a user