Skip to content

Commit

Permalink
Set pullChanged when setting --pull on compose up
Browse files Browse the repository at this point in the history
Add e2e tests

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
  • Loading branch information
laurazard authored and ndeloof committed Dec 30, 2022
1 parent ffce33e commit a224780
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/compose/up.go
Expand Up @@ -93,6 +93,7 @@ func upCommand(p *ProjectOptions, streams api.Streams, backend api.Service) *cob
Use: "up [OPTIONS] [SERVICE...]",
Short: "Create and start containers",
PreRunE: AdaptCmd(func(ctx context.Context, cmd *cobra.Command, args []string) error {
create.pullChanged = cmd.Flags().Changed("pull")
create.timeChanged = cmd.Flags().Changed("timeout")
return validateFlags(&up, &create)
}),
Expand Down
15 changes: 15 additions & 0 deletions e2e/cucumber-features/up.feature
@@ -0,0 +1,15 @@
Feature: Up

Background:
Given a compose file
"""
services:
simple:
image: alpine
command: top
"""

Scenario: --pull always
When I run "compose up --pull=always -d"
Then the output contains "simple Pulled"

0 comments on commit a224780

Please sign in to comment.