mirror of https://github.com/docker/docs.git
pull only latest if no tag
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
b04197d3c0
commit
b9e600d38d
|
@ -403,6 +403,9 @@ func (n *node) destroy(container *cluster.Container, force bool) error {
|
|||
}
|
||||
|
||||
func (n *node) pull(image string) error {
|
||||
if !strings.Contains(image, ":") {
|
||||
image = image + ":latest"
|
||||
}
|
||||
if err := n.client.PullImage(image, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ func TestCreateContainer(t *testing.T) {
|
|||
name = "test3"
|
||||
id = "id3"
|
||||
mockConfig.CpuShares = config.CpuShares * mockInfo.NCPU
|
||||
client.On("PullImage", config.Image, mock.Anything).Return(nil).Once()
|
||||
client.On("PullImage", config.Image+":latest", mock.Anything).Return(nil).Once()
|
||||
client.On("CreateContainer", &mockConfig, name).Return("", dockerclient.ErrNotFound).Once()
|
||||
client.On("CreateContainer", &mockConfig, name).Return(id, nil).Once()
|
||||
client.On("ListContainers", true, false, fmt.Sprintf(`{"id":[%q]}`, id)).Return([]dockerclient.Container{{Id: id}}, nil).Once()
|
||||
|
|
Loading…
Reference in New Issue