File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ type createOptions struct {
31
31
Build bool
32
32
noBuild bool
33
33
Pull string
34
+ pullChanged bool
34
35
removeOrphans bool
35
36
ignoreOrphans bool
36
37
forceRecreate bool
@@ -47,7 +48,8 @@ func createCommand(p *projectOptions, backend api.Service) *cobra.Command {
47
48
cmd := & cobra.Command {
48
49
Use : "create [OPTIONS] [SERVICE...]" ,
49
50
Short : "Creates containers for a service." ,
50
- PreRunE : Adapt (func (ctx context.Context , args []string ) error {
51
+ PreRunE : AdaptCmd (func (ctx context.Context , cmd * cobra.Command , args []string ) error {
52
+ opts .pullChanged = cmd .Flags ().Changed ("pull" )
51
53
if opts .Build && opts .noBuild {
52
54
return fmt .Errorf ("--build and --no-build are incompatible" )
53
55
}
@@ -108,7 +110,7 @@ func (opts createOptions) GetTimeout() *time.Duration {
108
110
}
109
111
110
112
func (opts createOptions ) Apply (project * types.Project ) {
111
- if opts .Pull != "" {
113
+ if opts .pullChanged {
112
114
for i , service := range project .Services {
113
115
service .PullPolicy = opts .Pull
114
116
project .Services [i ] = service
You can’t perform that action at this time.
0 commit comments