diff --git a/pkg/build/controller/strategy/custom.go b/pkg/build/controller/strategy/custom.go index 8c0bd3377e21..e1dc7243081e 100644 --- a/pkg/build/controller/strategy/custom.go +++ b/pkg/build/controller/strategy/custom.go @@ -12,7 +12,6 @@ import ( // CustomBuildStrategy creates a build using a custom builder image. type CustomBuildStrategy struct { - UseLocalImages bool // Codec is the codec to use for encoding the output pod. // IMPORTANT: This may break backwards compatibility when // it changes. @@ -69,10 +68,7 @@ func (bs *CustomBuildStrategy) CreateBuildPod(build *buildapi.Build) (*kapi.Pod, return nil, err } - if bs.UseLocalImages { - pod.Spec.Containers[0].ImagePullPolicy = kapi.PullIfNotPresent - } - + pod.Spec.Containers[0].ImagePullPolicy = kapi.PullIfNotPresent if strategy.ExposeDockerSocket { setupDockerSocket(pod) setupDockerConfig(pod) diff --git a/pkg/build/controller/strategy/custom_test.go b/pkg/build/controller/strategy/custom_test.go index 30935df97bc6..e3cd80da7f41 100644 --- a/pkg/build/controller/strategy/custom_test.go +++ b/pkg/build/controller/strategy/custom_test.go @@ -11,8 +11,7 @@ import ( func TestCustomCreateBuildPod(t *testing.T) { strategy := CustomBuildStrategy{ - UseLocalImages: true, - Codec: v1beta1.Codec, + Codec: v1beta1.Codec, } expectedBad := mockCustomBuild() diff --git a/pkg/build/controller/strategy/docker.go b/pkg/build/controller/strategy/docker.go index 14fe280f762d..f9a4f362c9cf 100644 --- a/pkg/build/controller/strategy/docker.go +++ b/pkg/build/controller/strategy/docker.go @@ -9,8 +9,7 @@ import ( // DockerBuildStrategy creates a Docker build using a Docker builder image. type DockerBuildStrategy struct { - Image string - UseLocalImages bool + Image string // Codec is the codec to use for encoding the output pod. // IMPORTANT: This may break backwards compatibility when // it changes. @@ -47,9 +46,7 @@ func (bs *DockerBuildStrategy) CreateBuildPod(build *buildapi.Build) (*kapi.Pod, }, } - if bs.UseLocalImages { - pod.Spec.Containers[0].ImagePullPolicy = kapi.PullIfNotPresent - } + pod.Spec.Containers[0].ImagePullPolicy = kapi.PullIfNotPresent setupDockerSocket(pod) setupDockerConfig(pod) diff --git a/pkg/build/controller/strategy/docker_test.go b/pkg/build/controller/strategy/docker_test.go index 4666c12cf3d6..48c49193c79a 100644 --- a/pkg/build/controller/strategy/docker_test.go +++ b/pkg/build/controller/strategy/docker_test.go @@ -11,9 +11,8 @@ import ( func TestDockerCreateBuildPod(t *testing.T) { strategy := DockerBuildStrategy{ - Image: "docker-test-image", - UseLocalImages: true, - Codec: v1beta1.Codec, + Image: "docker-test-image", + Codec: v1beta1.Codec, } expected := mockDockerBuild() diff --git a/pkg/build/controller/strategy/sti.go b/pkg/build/controller/strategy/sti.go index 58d0f8df44cb..38e47cf5502c 100644 --- a/pkg/build/controller/strategy/sti.go +++ b/pkg/build/controller/strategy/sti.go @@ -13,7 +13,6 @@ import ( type STIBuildStrategy struct { Image string TempDirectoryCreator TempDirectoryCreator - UseLocalImages bool // Codec is the codec to use for encoding the output pod. // IMPORTANT: This may break backwards compatibility when // it changes. @@ -69,9 +68,7 @@ func (bs *STIBuildStrategy) CreateBuildPod(build *buildapi.Build) (*kapi.Pod, er }, } - if bs.UseLocalImages { - pod.Spec.Containers[0].ImagePullPolicy = kapi.PullIfNotPresent - } + pod.Spec.Containers[0].ImagePullPolicy = kapi.PullIfNotPresent setupDockerSocket(pod) setupDockerConfig(pod) diff --git a/pkg/build/controller/strategy/sti_test.go b/pkg/build/controller/strategy/sti_test.go index 4f0af4078459..5c1ace1fc307 100644 --- a/pkg/build/controller/strategy/sti_test.go +++ b/pkg/build/controller/strategy/sti_test.go @@ -19,7 +19,6 @@ func TestSTICreateBuildPod(t *testing.T) { strategy := &STIBuildStrategy{ Image: "sti-test-image", TempDirectoryCreator: &FakeTempDirCreator{}, - UseLocalImages: true, Codec: v1beta1.Codec, } diff --git a/pkg/cmd/server/origin/master.go b/pkg/cmd/server/origin/master.go index 1ed794d91b7b..db578218bc38 100644 --- a/pkg/cmd/server/origin/master.go +++ b/pkg/cmd/server/origin/master.go @@ -121,9 +121,6 @@ type MasterConfig struct { AdmissionControl admission.Interface - // true if the system should use pullIfNotPresent for images (which means updates will not be fetched aggressively) - UseLocalImages bool - // a function that returns the appropriate image to use for a named component ImageFor func(component string) string @@ -605,7 +602,6 @@ func (c *MasterConfig) RunBuildController() { // initialize build controller dockerImage := c.ImageFor("docker-builder") stiImage := c.ImageFor("sti-builder") - useLocalImages := c.UseLocalImages osclient, kclient := c.BuildControllerClients() factory := buildcontrollerfactory.BuildControllerFactory{ @@ -613,20 +609,17 @@ func (c *MasterConfig) RunBuildController() { KubeClient: kclient, BuildUpdater: buildclient.NewOSClientBuildClient(osclient), DockerBuildStrategy: &buildstrategy.DockerBuildStrategy{ - Image: dockerImage, - UseLocalImages: useLocalImages, + Image: dockerImage, // TODO: this will be set to --storage-version (the internal schema we use) Codec: v1beta1.Codec, }, STIBuildStrategy: &buildstrategy.STIBuildStrategy{ Image: stiImage, TempDirectoryCreator: buildstrategy.STITempDirectoryCreator, - UseLocalImages: useLocalImages, // TODO: this will be set to --storage-version (the internal schema we use) Codec: v1beta1.Codec, }, CustomBuildStrategy: &buildstrategy.CustomBuildStrategy{ - UseLocalImages: useLocalImages, // TODO: this will be set to --storage-version (the internal schema we use) Codec: v1beta1.Codec, }, @@ -656,7 +649,6 @@ func (c *MasterConfig) RunDeploymentController() { {Name: "KUBERNETES_MASTER", Value: c.MasterAddr}, {Name: "OPENSHIFT_MASTER", Value: c.MasterAddr}, }, - UseLocalImages: c.UseLocalImages, RecreateStrategyImage: c.ImageFor("deployer"), } diff --git a/pkg/cmd/server/start.go b/pkg/cmd/server/start.go index 5d79a359dd86..60a89d25e975 100644 --- a/pkg/cmd/server/start.go +++ b/pkg/cmd/server/start.go @@ -275,7 +275,6 @@ func start(cfg *config, args []string) error { // define a function for resolving components to names imageResolverFn := cfg.ImageTemplate.ExpandOrDie - useLocalImages := env("USE_LOCAL_IMAGES", "false") == "true" // the node can reuse an existing client var existingKubeClient *kclient.Client @@ -372,8 +371,7 @@ func start(cfg *config, args []string) error { MasterAuthorizationNamespace: masterAuthorizationNamespace, RequestContextMapper: requestContextMapper, - UseLocalImages: useLocalImages, - ImageFor: imageResolverFn, + ImageFor: imageResolverFn, } if startKube { diff --git a/pkg/deploy/controller/deployment_controller.go b/pkg/deploy/controller/deployment_controller.go index b08280efdbd5..910f79b66ca1 100644 --- a/pkg/deploy/controller/deployment_controller.go +++ b/pkg/deploy/controller/deployment_controller.go @@ -32,8 +32,6 @@ type DeploymentController struct { // Environment is a set of environment which should be injected into all deployment pod // containers, in addition to whatever environment is specified by the ContainerCreator. Environment []kapi.EnvVar - // UseLocalImages configures the ImagePullPolicy for containers in the deployment pod. - UseLocalImages bool // Codec is used to decode DeploymentConfigs. Codec runtime.Codec // Stop is an optional channel that controls when the controller exits. @@ -197,9 +195,7 @@ func (dc *DeploymentController) makeDeployerPod(deployment *kapi.ReplicationCont }, } - if dc.UseLocalImages { - pod.Spec.Containers[0].ImagePullPolicy = kapi.PullIfNotPresent - } + pod.Spec.Containers[0].ImagePullPolicy = kapi.PullIfNotPresent return pod, nil } diff --git a/pkg/deploy/controller/factory/factory.go b/pkg/deploy/controller/factory/factory.go index 3a7af8059857..36923cf9fa5a 100644 --- a/pkg/deploy/controller/factory/factory.go +++ b/pkg/deploy/controller/factory/factory.go @@ -70,8 +70,6 @@ type DeploymentControllerFactory struct { KubeClient *kclient.Client // Environment is a set of environment which should be injected into all deployment pod containers. Environment []kapi.EnvVar - // UseLocalImages configures the ImagePullPolicy for containers deployment pods. - UseLocalImages bool // RecreateStrategyImage specifies which Docker image which should implement the Recreate strategy. RecreateStrategyImage string // Codec is used to decode DeploymentConfigs. @@ -152,9 +150,8 @@ func (factory *DeploymentControllerFactory) Create() *controller.DeploymentContr panicIfStopped(factory.Stop, "deployment controller stopped") return pod }, - UseLocalImages: factory.UseLocalImages, - Codec: factory.Codec, - Stop: factory.Stop, + Codec: factory.Codec, + Stop: factory.Stop, } } diff --git a/test/integration/buildclient_test.go b/test/integration/buildclient_test.go index b549fed4f730..604e3ac72d6a 100644 --- a/test/integration/buildclient_test.go +++ b/test/integration/buildclient_test.go @@ -209,14 +209,12 @@ func NewTestBuildOpenshift(t *testing.T) *testBuildOpenshift { KubeClient: kubeClient, BuildUpdater: buildclient.NewOSClientBuildClient(osClient), DockerBuildStrategy: &buildstrategy.DockerBuildStrategy{ - Image: "test-docker-builder", - UseLocalImages: false, - Codec: latest.Codec, + Image: "test-docker-builder", + Codec: latest.Codec, }, STIBuildStrategy: &buildstrategy.STIBuildStrategy{ Image: "test-sti-builder", TempDirectoryCreator: buildstrategy.STITempDirectoryCreator, - UseLocalImages: false, Codec: latest.Codec, }, Stop: openshift.stop,