Skip to content

Commit f7c3f5b

Browse files
feat: added ImagePullPolicy config support at env var and global level (#1910)
* GITOPS-7732: added ImagePullPolicy config support at env var and global level Signed-off-by: Alka Kumari <alkumari@redhat.com> * removed ImagePullPolicy validation from argocdagent/deployment_test Signed-off-by: Alka Kumari <alkumari@redhat.com> * fixed test cases failing because of hardcoded ImagePullPolicy Signed-off-by: Alka Kumari <alkumari@redhat.com> * removed hardcoded ImagePullPolicy for image-updater Signed-off-by: Alka Kumari <alkumari@redhat.com> * added reviewed changes for ImagePullPolicy Signed-off-by: Alka Kumari <alkumari@redhat.com> * improved test cases and doc for ImagePullPolicy Signed-off-by: Alka Kumari <alkumari@redhat.com> * changed defaukt value of imagePullPolicy in ginkgo tests Signed-off-by: Alka Kumari <alkumari@redhat.com> * Added suggested changes Signed-off-by: Alka Kumari <alkumari@redhat.com> * improved imagePullPolicy ginkgo test cases Signed-off-by: Alka Kumari <alkumari@redhat.com> --------- Signed-off-by: Alka Kumari <alkumari@redhat.com>
1 parent 18184f2 commit f7c3f5b

30 files changed

+936
-30
lines changed

api/v1alpha1/argocd_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,12 @@ type ArgoCDSpec struct {
739739
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Image",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD","urn:alm:descriptor:com.tectonic.ui:text"}
740740
Image string `json:"image,omitempty"`
741741

742+
// ImagePullPolicy is the image pull policy for all ArgoCD components.
743+
// Valid values are Always, IfNotPresent, Never. If not specified, defaults to the operator's global setting.
744+
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Image Pull Policy",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD","urn:alm:descriptor:com.tectonic.ui:text","urn:alm:descriptor:com.tectonic.ui:fieldDependency:image:enable"}
745+
// +kubebuilder:validation:Enum=Always;IfNotPresent;Never
746+
ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
747+
742748
// Import is the import/restore options for ArgoCD.
743749
Import *ArgoCDImportSpec `json:"import,omitempty"`
744750

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/argocd_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,12 @@ type ArgoCDSpec struct {
900900
// ImageUpdater defines whether the Argo CD ImageUpdater controller should be installed.
901901
ImageUpdater ArgoCDImageUpdaterSpec `json:"imageUpdater,omitempty"`
902902

903+
// ImagePullPolicy is the image pull policy for all ArgoCD components.
904+
// Valid values are Always, IfNotPresent, Never. If not specified, defaults to the operator's global setting.
905+
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Image Pull Policy",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD","urn:alm:descriptor:com.tectonic.ui:text","urn:alm:descriptor:com.tectonic.ui:fieldDependency:image:enable"}
906+
// +kubebuilder:validation:Enum=Always;IfNotPresent;Never
907+
ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
908+
903909
// Import is the import/restore options for ArgoCD.
904910
Import *ArgoCDImportSpec `json:"import,omitempty"`
905911

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/manifests/argocd-operator.clusterserviceversion.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ metadata:
257257
capabilities: Deep Insights
258258
categories: Integration & Delivery
259259
certified: "false"
260-
createdAt: "2025-10-14T18:26:44Z"
260+
createdAt: "2025-10-16T08:06:36Z"
261261
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
262262
operators.operatorframework.io/builder: operator-sdk-v1.35.0
263263
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
@@ -603,6 +603,15 @@ spec:
603603
x-descriptors:
604604
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD
605605
- urn:alm:descriptor:com.tectonic.ui:text
606+
- description: ImagePullPolicy is the image pull policy for all ArgoCD components.
607+
Valid values are Always, IfNotPresent, Never. If not specified, defaults
608+
to the operator's global setting.
609+
displayName: Image Pull Policy
610+
path: imagePullPolicy
611+
x-descriptors:
612+
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD
613+
- urn:alm:descriptor:com.tectonic.ui:text
614+
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:image:enable
606615
- description: Name of an ArgoCDExport from which to import data.
607616
displayName: Name
608617
path: import.name
@@ -1190,6 +1199,15 @@ spec:
11901199
x-descriptors:
11911200
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD
11921201
- urn:alm:descriptor:com.tectonic.ui:text
1202+
- description: ImagePullPolicy is the image pull policy for all ArgoCD components.
1203+
Valid values are Always, IfNotPresent, Never. If not specified, defaults
1204+
to the operator's global setting.
1205+
displayName: Image Pull Policy
1206+
path: imagePullPolicy
1207+
x-descriptors:
1208+
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD
1209+
- urn:alm:descriptor:com.tectonic.ui:text
1210+
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:image:enable
11931211
- description: Name of an ArgoCDExport from which to import data.
11941212
displayName: Name
11951213
path: import.name

bundle/manifests/argoproj.io_argocds.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,15 @@ spec:
14251425
image:
14261426
description: Image is the ArgoCD container image for all ArgoCD components.
14271427
type: string
1428+
imagePullPolicy:
1429+
description: |-
1430+
ImagePullPolicy is the image pull policy for all ArgoCD components.
1431+
Valid values are Always, IfNotPresent, Never. If not specified, defaults to the operator's global setting.
1432+
enum:
1433+
- Always
1434+
- IfNotPresent
1435+
- Never
1436+
type: string
14281437
import:
14291438
description: Import is the import/restore options for ArgoCD.
14301439
properties:
@@ -16064,6 +16073,15 @@ spec:
1606416073
image:
1606516074
description: Image is the ArgoCD container image for all ArgoCD components.
1606616075
type: string
16076+
imagePullPolicy:
16077+
description: |-
16078+
ImagePullPolicy is the image pull policy for all ArgoCD components.
16079+
Valid values are Always, IfNotPresent, Never. If not specified, defaults to the operator's global setting.
16080+
enum:
16081+
- Always
16082+
- IfNotPresent
16083+
- Never
16084+
type: string
1606716085
imageUpdater:
1606816086
description: ImageUpdater defines whether the Argo CD ImageUpdater
1606916087
controller should be installed.

common/defaults.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ vs-ssh.visualstudio.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7Hr1oTWqNqOlzGJOf
292292

293293
// ArgoCDImageUpdaterControllerComponent is the name of the Image Updater controller control plane component
294294
ArgoCDImageUpdaterControllerComponent = "argocd-image-updater-controller"
295+
296+
// DefaultImagePullPolicy is the default image pull policy to use when not specified.
297+
DefaultImagePullPolicy = "IfNotPresent"
295298
)
296299

297300
// DefaultLabels returns the default set of labels for controllers.

common/keys.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,4 +242,8 @@ const (
242242
// ArgoCDImageUpdaterImageEnvName is the environment variable used to get the image
243243
// to used for the Image Updater container.
244244
ArgoCDImageUpdaterImageEnvName = "ARGOCD_IMAGE_UPDATER_IMAGE"
245+
246+
// ArgoCDImagePullPolicyEnvName is the environment variable used to get the global image pull policy
247+
// for all ArgoCD components managed by the operator.
248+
ArgoCDImagePullPolicyEnvName = "IMAGE_PULL_POLICY"
245249
)

config/crd/bases/argoproj.io_argocds.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,15 @@ spec:
14141414
image:
14151415
description: Image is the ArgoCD container image for all ArgoCD components.
14161416
type: string
1417+
imagePullPolicy:
1418+
description: |-
1419+
ImagePullPolicy is the image pull policy for all ArgoCD components.
1420+
Valid values are Always, IfNotPresent, Never. If not specified, defaults to the operator's global setting.
1421+
enum:
1422+
- Always
1423+
- IfNotPresent
1424+
- Never
1425+
type: string
14171426
import:
14181427
description: Import is the import/restore options for ArgoCD.
14191428
properties:
@@ -16053,6 +16062,15 @@ spec:
1605316062
image:
1605416063
description: Image is the ArgoCD container image for all ArgoCD components.
1605516064
type: string
16065+
imagePullPolicy:
16066+
description: |-
16067+
ImagePullPolicy is the image pull policy for all ArgoCD components.
16068+
Valid values are Always, IfNotPresent, Never. If not specified, defaults to the operator's global setting.
16069+
enum:
16070+
- Always
16071+
- IfNotPresent
16072+
- Never
16073+
type: string
1605616074
imageUpdater:
1605716075
description: ImageUpdater defines whether the Argo CD ImageUpdater
1605816076
controller should be installed.

config/manifests/bases/argocd-operator.clusterserviceversion.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,15 @@ spec:
409409
x-descriptors:
410410
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD
411411
- urn:alm:descriptor:com.tectonic.ui:text
412+
- description: ImagePullPolicy is the image pull policy for all ArgoCD components.
413+
Valid values are Always, IfNotPresent, Never. If not specified, defaults
414+
to the operator's global setting.
415+
displayName: Image Pull Policy
416+
path: imagePullPolicy
417+
x-descriptors:
418+
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD
419+
- urn:alm:descriptor:com.tectonic.ui:text
420+
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:image:enable
412421
- description: Name of an ArgoCDExport from which to import data.
413422
displayName: Name
414423
path: import.name
@@ -1019,6 +1028,15 @@ spec:
10191028
x-descriptors:
10201029
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD
10211030
- urn:alm:descriptor:com.tectonic.ui:text
1031+
- description: ImagePullPolicy is the image pull policy for all ArgoCD components.
1032+
Valid values are Always, IfNotPresent, Never. If not specified, defaults
1033+
to the operator's global setting.
1034+
displayName: Image Pull Policy
1035+
path: imagePullPolicy
1036+
x-descriptors:
1037+
- urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD
1038+
- urn:alm:descriptor:com.tectonic.ui:text
1039+
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:image:enable
10221040
- description: Name of an ArgoCDExport from which to import data.
10231041
displayName: Name
10241042
path: import.name

0 commit comments

Comments
 (0)