diff --git a/cmd/s2i/main.go b/cmd/s2i/main.go index 681b19105..45fd56690 100644 --- a/cmd/s2i/main.go +++ b/cmd/s2i/main.go @@ -86,9 +86,6 @@ $ s2i build . centos/ruby-22-centos7 hello-world-app fmt.Fprintln(os.Stderr, "ERROR: Incremental build with runtime image isn't supported") os.Exit(1) } - if cfg.ForcePull { - glog.Warning("DEPRECATED: The '--force-pull' option is deprecated. Use '--pull-policy' instead") - } //set default image pull policy if len(cfg.BuilderPullPolicy) == 0 { cfg.BuilderPullPolicy = api.DefaultBuilderPullPolicy diff --git a/contrib/completions/bash/s2i b/contrib/completions/bash/s2i index 98ec98775..98dc85c79 100644 --- a/contrib/completions/bash/s2i +++ b/contrib/completions/bash/s2i @@ -266,8 +266,6 @@ _s2i_build() local_nonpersistent_flags+=("--environment-file=") flags+=("--exclude=") local_nonpersistent_flags+=("--exclude=") - flags+=("--force-pull") - local_nonpersistent_flags+=("--force-pull") flags+=("--ignore-submodules") local_nonpersistent_flags+=("--ignore-submodules") flags+=("--incremental") @@ -396,8 +394,6 @@ _s2i_rebuild() local_nonpersistent_flags+=("--destination=") flags+=("--dockercfg-path=") local_nonpersistent_flags+=("--dockercfg-path=") - flags+=("--force-pull") - local_nonpersistent_flags+=("--force-pull") flags+=("--incremental") local_nonpersistent_flags+=("--incremental") flags+=("--incremental-pull-policy=") @@ -446,8 +442,6 @@ _s2i_usage() local_nonpersistent_flags+=("--destination=") flags+=("--dockercfg-path=") local_nonpersistent_flags+=("--dockercfg-path=") - flags+=("--force-pull") - local_nonpersistent_flags+=("--force-pull") flags+=("--incremental") local_nonpersistent_flags+=("--incremental") flags+=("--incremental-pull-policy=") diff --git a/contrib/completions/zsh/s2i b/contrib/completions/zsh/s2i index 479f0cc28..1e5b4d7aa 100644 --- a/contrib/completions/zsh/s2i +++ b/contrib/completions/zsh/s2i @@ -427,8 +427,6 @@ _s2i_build() local_nonpersistent_flags+=("--environment-file=") flags+=("--exclude=") local_nonpersistent_flags+=("--exclude=") - flags+=("--force-pull") - local_nonpersistent_flags+=("--force-pull") flags+=("--ignore-submodules") local_nonpersistent_flags+=("--ignore-submodules") flags+=("--incremental") @@ -557,8 +555,6 @@ _s2i_rebuild() local_nonpersistent_flags+=("--destination=") flags+=("--dockercfg-path=") local_nonpersistent_flags+=("--dockercfg-path=") - flags+=("--force-pull") - local_nonpersistent_flags+=("--force-pull") flags+=("--incremental") local_nonpersistent_flags+=("--incremental") flags+=("--incremental-pull-policy=") @@ -607,8 +603,6 @@ _s2i_usage() local_nonpersistent_flags+=("--destination=") flags+=("--dockercfg-path=") local_nonpersistent_flags+=("--dockercfg-path=") - flags+=("--force-pull") - local_nonpersistent_flags+=("--force-pull") flags+=("--incremental") local_nonpersistent_flags+=("--incremental") flags+=("--incremental-pull-policy=") diff --git a/hack/test-stirunimage.sh b/hack/test-stirunimage.sh index a41e51146..c709e8306 100755 --- a/hack/test-stirunimage.sh +++ b/hack/test-stirunimage.sh @@ -117,7 +117,7 @@ check_result $? "${WORK_DIR}/s2i-non-repo.log" test_debug "s2i rebuild" s2i build https://github.com/openshift/sti-php.git --context-dir=5.5/test/test-app registry.access.redhat.com/openshift3/php-55-rhel7 rack-test-app --incremental=true --loglevel=5 &> "${WORK_DIR}/s2i-pre-rebuild.log" check_result $? "${WORK_DIR}/s2i-pre-rebuild.log" -s2i rebuild rack-test-app:latest rack-test-app:v1 --force-pull=false -p never --loglevel=5 &> "${WORK_DIR}/s2i-rebuild.log" +s2i rebuild rack-test-app:latest rack-test-app:v1 -p never --loglevel=5 &> "${WORK_DIR}/s2i-rebuild.log" check_result $? "${WORK_DIR}/s2i-rebuild.log" test_debug "s2i usage" diff --git a/pkg/api/types.go b/pkg/api/types.go index da2e1bdbe..2df3d084b 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -128,12 +128,6 @@ type Config struct { // when doing incremental build PreviousImagePullPolicy PullPolicy - // ForcePull defines if the builder image should be always pulled or not. - // This is now deprecated by BuilderPullPolicy and will be removed soon. - // Setting this to 'true' equals setting BuilderPullPolicy to 'PullAlways'. - // Setting this to 'false' equals setting BuilderPullPolicy to 'PullIfNotPresent' - ForcePull bool - // Incremental describes whether to try to perform incremental build. Incremental bool diff --git a/pkg/build/strategies/sti/sti.go b/pkg/build/strategies/sti/sti.go index 287118dde..83471166c 100644 --- a/pkg/build/strategies/sti/sti.go +++ b/pkg/build/strategies/sti/sti.go @@ -472,7 +472,7 @@ func (builder *STI) Exists(config *api.Config) bool { tag := firstNonEmpty(config.IncrementalFromTag, config.Tag) startTime := time.Now() - result, err := dockerpkg.PullImage(tag, builder.incrementalDocker, policy, false) + result, err := dockerpkg.PullImage(tag, builder.incrementalDocker, policy) builder.result.BuildInfo.Stages = api.RecordStageAndStepInfo(builder.result.BuildInfo.Stages, api.StagePullImages, api.StepPullPreviousImage, startTime, time.Now()) if err != nil { diff --git a/pkg/cmd/util.go b/pkg/cmd/util.go index 3ea24de92..0954bb7d0 100644 --- a/pkg/cmd/util.go +++ b/pkg/cmd/util.go @@ -18,8 +18,6 @@ func AddCommonFlags(c *cobra.Command, cfg *api.Config) { "Remove the previous image during incremental builds") c.Flags().StringVar(&(cfg.CallbackURL), "callback-url", "", "Specify a URL to invoke via HTTP POST upon build completion") - c.Flags().BoolVar(&(cfg.ForcePull), "force-pull", false, - "DEPRECATED: Always pull the builder image even if it is present locally") c.Flags().VarP(&(cfg.BuilderPullPolicy), "pull-policy", "p", "Specify when to pull the builder image (always, never or if-not-present)") c.Flags().Var(&(cfg.PreviousImagePullPolicy), "incremental-pull-policy", diff --git a/pkg/docker/util.go b/pkg/docker/util.go index 565b5d4b7..2e8a7adcf 100644 --- a/pkg/docker/util.go +++ b/pkg/docker/util.go @@ -206,13 +206,7 @@ func parseRepositoryTag(repos string) (string, string, string) { // PullImage pulls the Docker image specified by name taking the pull policy // into the account. -// TODO: The 'force' option will be removed -func PullImage(name string, d Docker, policy api.PullPolicy, force bool) (*PullResult, error) { - // TODO: Remove this after we deprecate --force-pull - if force { - policy = api.PullAlways - } - +func PullImage(name string, d Docker, policy api.PullPolicy) (*PullResult, error) { if len(policy) == 0 { return nil, errors.New("the policy for pull image must be set") } @@ -305,8 +299,8 @@ func CheckReachable(config *api.Config) error { return err } -func pullAndCheck(image string, docker Docker, pullPolicy api.PullPolicy, config *api.Config, forcePull bool) (*PullResult, error) { - r, err := PullImage(image, docker, pullPolicy, forcePull) +func pullAndCheck(image string, docker Docker, pullPolicy api.PullPolicy, config *api.Config) (*PullResult, error) { + r, err := PullImage(image, docker, pullPolicy) if err != nil { return nil, err } @@ -329,7 +323,7 @@ func GetBuilderImage(config *api.Config) (*PullResult, error) { return nil, err } - return pullAndCheck(config.BuilderImage, d, config.BuilderPullPolicy, config, config.ForcePull) + return pullAndCheck(config.BuilderImage, d, config.BuilderPullPolicy, config) } // GetRebuildImage obtains the metadata information for the image specified in @@ -341,13 +335,13 @@ func GetRebuildImage(config *api.Config) (*PullResult, error) { return nil, err } - return pullAndCheck(config.Tag, d, config.BuilderPullPolicy, config, config.ForcePull) + return pullAndCheck(config.Tag, d, config.BuilderPullPolicy, config) } // GetRuntimeImage processes the config and performs operations necessary to // make the Docker image specified as RuntimeImage available locally. func GetRuntimeImage(config *api.Config, docker Docker) error { - _, err := pullAndCheck(config.RuntimeImage, docker, config.RuntimeImagePullPolicy, config, false) + _, err := pullAndCheck(config.RuntimeImage, docker, config.RuntimeImagePullPolicy, config) return err }