From 2080ae52f9d0f404471eadd0e6b67721a28a488b Mon Sep 17 00:00:00 2001 From: Nick Carboni Date: Tue, 16 Jun 2020 10:43:36 -0400 Subject: [PATCH] Explicitly set the image pull policy to IfNotPresent --- ...manageiq-operator.v0.0.1.clusterserviceversion.yaml | 2 +- manageiq-operator/deploy/operator.yaml | 2 +- manageiq-operator/pkg/helpers/miq-components/httpd.go | 1 + manageiq-operator/pkg/helpers/miq-components/kafka.go | 10 ++++++---- .../pkg/helpers/miq-components/memcached.go | 7 +++---- .../pkg/helpers/miq-components/postgresql.go | 5 +++-- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/manageiq-operator/deploy/olm-catalog/manageiq-operator/0.0.1/manageiq-operator.v0.0.1.clusterserviceversion.yaml b/manageiq-operator/deploy/olm-catalog/manageiq-operator/0.0.1/manageiq-operator.v0.0.1.clusterserviceversion.yaml index 3a8a315d..98b70897 100644 --- a/manageiq-operator/deploy/olm-catalog/manageiq-operator/0.0.1/manageiq-operator.v0.0.1.clusterserviceversion.yaml +++ b/manageiq-operator/deploy/olm-catalog/manageiq-operator/0.0.1/manageiq-operator.v0.0.1.clusterserviceversion.yaml @@ -58,7 +58,7 @@ spec: - name: OPERATOR_NAME value: manageiq-operator image: docker.io/manageiq/manageiq-operator:v0.0.1 - imagePullPolicy: Always + imagePullPolicy: IfNotPresent name: manageiq-operator resources: limits: diff --git a/manageiq-operator/deploy/operator.yaml b/manageiq-operator/deploy/operator.yaml index fccaa8e2..e7919a98 100644 --- a/manageiq-operator/deploy/operator.yaml +++ b/manageiq-operator/deploy/operator.yaml @@ -18,7 +18,7 @@ spec: image: docker.io/manageiq/manageiq-operator:v0.0.1 command: - manageiq-operator - imagePullPolicy: Always + imagePullPolicy: IfNotPresent env: - name: WATCH_NAMESPACE valueFrom: diff --git a/manageiq-operator/pkg/helpers/miq-components/httpd.go b/manageiq-operator/pkg/helpers/miq-components/httpd.go index 5e41ad40..f114a581 100644 --- a/manageiq-operator/pkg/helpers/miq-components/httpd.go +++ b/manageiq-operator/pkg/helpers/miq-components/httpd.go @@ -223,6 +223,7 @@ func assignHttpdPorts(privileged bool, c *corev1.Container) { func initializeHttpdContainer(spec *miqv1alpha1.ManageIQSpec, privileged bool, c *corev1.Container) error { c.Name = "httpd" c.Image = httpdImage(spec.HttpdImageNamespace, spec.HttpdImageTag, privileged) + c.ImagePullPolicy = corev1.PullIfNotPresent if privileged { c.LivenessProbe = &corev1.Probe{ Handler: corev1.Handler{ diff --git a/manageiq-operator/pkg/helpers/miq-components/kafka.go b/manageiq-operator/pkg/helpers/miq-components/kafka.go index 352f2c6e..52912262 100644 --- a/manageiq-operator/pkg/helpers/miq-components/kafka.go +++ b/manageiq-operator/pkg/helpers/miq-components/kafka.go @@ -151,8 +151,9 @@ func ZookeeperService(cr *miqv1alpha1.ManageIQ) *corev1.Service { func KafkaDeployment(cr *miqv1alpha1.ManageIQ) (*appsv1.Deployment, error) { container := corev1.Container{ - Name: "kafka", - Image: cr.Spec.KafkaImageName + ":" + cr.Spec.KafkaImageTag, + Name: "kafka", + Image: cr.Spec.KafkaImageName + ":" + cr.Spec.KafkaImageTag, + ImagePullPolicy: corev1.PullIfNotPresent, Ports: []corev1.ContainerPort{ corev1.ContainerPort{ ContainerPort: 9092, @@ -248,8 +249,9 @@ func KafkaDeployment(cr *miqv1alpha1.ManageIQ) (*appsv1.Deployment, error) { func ZookeeperDeployment(cr *miqv1alpha1.ManageIQ) (*appsv1.Deployment, error) { container := corev1.Container{ - Name: "zookeeper", - Image: cr.Spec.ZookeeperImageName + ":" + cr.Spec.ZookeeperImageTag, + Name: "zookeeper", + Image: cr.Spec.ZookeeperImageName + ":" + cr.Spec.ZookeeperImageTag, + ImagePullPolicy: corev1.PullIfNotPresent, Ports: []corev1.ContainerPort{ corev1.ContainerPort{ ContainerPort: 2181, diff --git a/manageiq-operator/pkg/helpers/miq-components/memcached.go b/manageiq-operator/pkg/helpers/miq-components/memcached.go index 8e64cd4b..3ac00ba2 100644 --- a/manageiq-operator/pkg/helpers/miq-components/memcached.go +++ b/manageiq-operator/pkg/helpers/miq-components/memcached.go @@ -12,16 +12,15 @@ import ( func NewMemcachedDeployment(cr *miqv1alpha1.ManageIQ, scheme *runtime.Scheme) (*appsv1.Deployment, controllerutil.MutateFn, error) { container := corev1.Container{ - Name: "memcached", - Image: cr.Spec.MemcachedImageName + ":" + cr.Spec.MemcachedImageTag, - + Name: "memcached", + Image: cr.Spec.MemcachedImageName + ":" + cr.Spec.MemcachedImageTag, + ImagePullPolicy: corev1.PullIfNotPresent, Ports: []corev1.ContainerPort{ corev1.ContainerPort{ ContainerPort: 11211, Protocol: "TCP", }, }, - LivenessProbe: &corev1.Probe{ Handler: corev1.Handler{ TCPSocket: &corev1.TCPSocketAction{ diff --git a/manageiq-operator/pkg/helpers/miq-components/postgresql.go b/manageiq-operator/pkg/helpers/miq-components/postgresql.go index 393b657f..0b6848a4 100644 --- a/manageiq-operator/pkg/helpers/miq-components/postgresql.go +++ b/manageiq-operator/pkg/helpers/miq-components/postgresql.go @@ -115,8 +115,9 @@ func NewPostgresqlService(cr *miqv1alpha1.ManageIQ) *corev1.Service { func NewPostgresqlDeployment(cr *miqv1alpha1.ManageIQ) (*appsv1.Deployment, error) { var initialDelaySecs int32 = 60 container := corev1.Container{ - Name: "postgresql", - Image: cr.Spec.PostgresqlImageName + ":" + cr.Spec.PostgresqlImageTag, + Name: "postgresql", + Image: cr.Spec.PostgresqlImageName + ":" + cr.Spec.PostgresqlImageTag, + ImagePullPolicy: corev1.PullIfNotPresent, Ports: []corev1.ContainerPort{ corev1.ContainerPort{ ContainerPort: 5432,