mirror of
https://github.com/docker/compose.git
synced 2025-07-01 10:54:29 +02:00
Merge pull request #9777 from nicksieger/compose-9773-pull-always
pull: always pull when policy not specified
This commit is contained in:
commit
157d38aa69
@ -96,15 +96,6 @@ func (s *composeService) pull(ctx context.Context, project *types.Project, opts
|
|||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
if _, ok := images[service.Image]; ok {
|
|
||||||
w.Event(progress.Event{
|
|
||||||
ID: service.Name,
|
|
||||||
Status: progress.Done,
|
|
||||||
Text: "Skipped - Image is already present locally",
|
|
||||||
})
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if s, ok := imagesBeingPulled[service.Image]; ok {
|
if s, ok := imagesBeingPulled[service.Image]; ok {
|
||||||
|
@ -131,6 +131,13 @@ func TestComposePull(t *testing.T) {
|
|||||||
|
|
||||||
assert.Assert(t, strings.Contains(output, "simple Pulled"))
|
assert.Assert(t, strings.Contains(output, "simple Pulled"))
|
||||||
assert.Assert(t, strings.Contains(output, "another Pulled"))
|
assert.Assert(t, strings.Contains(output, "another Pulled"))
|
||||||
|
|
||||||
|
// verify default policy is 'always' for pull command
|
||||||
|
res = c.RunDockerComposeCmd(t, "--project-directory", "fixtures/compose-pull/simple", "pull")
|
||||||
|
output = res.Combined()
|
||||||
|
|
||||||
|
assert.Assert(t, strings.Contains(output, "simple Pulled"))
|
||||||
|
assert.Assert(t, strings.Contains(output, "another Pulled"))
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Verify a image is pulled once", func(t *testing.T) {
|
t.Run("Verify a image is pulled once", func(t *testing.T) {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
services:
|
services:
|
||||||
simple:
|
simple:
|
||||||
image: alpine:3.13.12
|
image: alpine:3.13.12
|
||||||
|
pull_policy: missing
|
||||||
command: top
|
command: top
|
||||||
|
Loading…
x
Reference in New Issue
Block a user