Skip to content

Commit

Permalink
Merge pull request #9777 from nicksieger/compose-9773-pull-always
Browse files Browse the repository at this point in the history
pull: always pull when policy not specified
  • Loading branch information
nicksieger committed Aug 22, 2022
2 parents 6eb3403 + 5723dee commit 157d38a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
9 changes: 0 additions & 9 deletions pkg/compose/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,6 @@ func (s *composeService) pull(ctx context.Context, project *types.Project, opts
})
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 {
Expand Down
7 changes: 7 additions & 0 deletions pkg/e2e/compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ func TestComposePull(t *testing.T) {

assert.Assert(t, strings.Contains(output, "simple 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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
services:
simple:
image: alpine:3.13.12
pull_policy: missing
command: top

0 comments on commit 157d38a

Please sign in to comment.