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 {
3131 Build bool
3232 noBuild bool
3333 Pull string
34+ pullChanged bool
3435 removeOrphans bool
3536 ignoreOrphans bool
3637 forceRecreate bool
@@ -47,7 +48,8 @@ func createCommand(p *projectOptions, backend api.Service) *cobra.Command {
4748 cmd := & cobra.Command {
4849 Use : "create [OPTIONS] [SERVICE...]" ,
4950 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" )
5153 if opts .Build && opts .noBuild {
5254 return fmt .Errorf ("--build and --no-build are incompatible" )
5355 }
@@ -108,7 +110,7 @@ func (opts createOptions) GetTimeout() *time.Duration {
108110}
109111
110112func (opts createOptions ) Apply (project * types.Project ) {
111- if opts .Pull != "" {
113+ if opts .pullChanged {
112114 for i , service := range project .Services {
113115 service .PullPolicy = opts .Pull
114116 project .Services [i ] = service
You can’t perform that action at this time.
0 commit comments