Skip to content

Commit 0f46891

Browse files
downstream ImagePullPolicy feature (#993)
* downstream ImagePullPolicy feature Signed-off-by: Alka Kumari <[email protected]> * improved ginkgo test for imagePullPolicy Signed-off-by: Alka Kumari <[email protected]> * refactored ginkgo test cases for imagePullPolicy Signed-off-by: Alka Kumari <[email protected]> --------- Signed-off-by: Alka Kumari <[email protected]>
1 parent 8bd51cf commit 0f46891

File tree

8 files changed

+482
-4
lines changed

8 files changed

+482
-4
lines changed

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.

bundle/manifests/gitops-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ metadata:
180180
capabilities: Deep Insights
181181
console.openshift.io/plugins: '["gitops-plugin"]'
182182
containerImage: quay.io/redhat-developer/gitops-operator
183-
createdAt: "2025-10-23T13:34:07Z"
183+
createdAt: "2025-10-29T14:30:25Z"
184184
description: Enables teams to adopt GitOps principles for managing cluster configurations
185185
and application delivery across hybrid multi-cluster Kubernetes environments.
186186
features.operators.openshift.io/disconnected: "true"

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.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.6
44

55
require (
66
github.com/argoproj-labs/argo-rollouts-manager v0.0.7-0.20251020065637-7f928e52c0d9
7-
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20251017041829-18184f26c64e
7+
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20251024105544-f7c3f5b0cc95
88
github.com/argoproj/argo-cd/v3 v3.1.8
99
github.com/argoproj/gitops-engine v0.7.1-0.20250905160054-e48120133eec
1010
github.com/go-logr/logr v1.4.3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFI
3131
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
3232
github.com/argoproj-labs/argo-rollouts-manager v0.0.7-0.20251020065637-7f928e52c0d9 h1:WcUWvh0qIqUaY+JfVIUfBV0ACv9ep2by3YEi04dRNr4=
3333
github.com/argoproj-labs/argo-rollouts-manager v0.0.7-0.20251020065637-7f928e52c0d9/go.mod h1:iVIrf0/GJPZR3NMtJvpo1Ui6qqPjpY34Lp+5RmZo9vY=
34-
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20251017041829-18184f26c64e h1:0JYIQ9qRNce5t7ak5mEL1hLk9S3CKukdjvlVJySJNzE=
35-
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20251017041829-18184f26c64e/go.mod h1:LTBNqNbKk9Us5xiCrK612HLOr8SJFfyxlMJQErzMghg=
34+
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20251024105544-f7c3f5b0cc95 h1:v2J4IPd8Fab5udUD7nMZsYflqGDhkVGx30q5uenMBbE=
35+
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20251024105544-f7c3f5b0cc95/go.mod h1:LTBNqNbKk9Us5xiCrK612HLOr8SJFfyxlMJQErzMghg=
3636
github.com/argoproj/argo-cd/v3 v3.1.8 h1:NkLPiRI5qGkV+q1EN3O7/0Wb9O/MVl62vadKteZqMUw=
3737
github.com/argoproj/argo-cd/v3 v3.1.8/go.mod h1:ZHb/LOz/hr88VWMJiVTd8DGYL7MheHCAT8S6DgYOBFo=
3838
github.com/argoproj/gitops-engine v0.7.1-0.20250905160054-e48120133eec h1:rNAwbRQFvRIuW/e2bU+B10mlzghYXsnwZedYeA7Drz4=

test/openshift/e2e/ginkgo/fixture/deployment/fixture.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,3 +427,24 @@ func fetchDeployment(f func(*appsv1.Deployment) bool) matcher.GomegaMatcher {
427427
}, BeTrue())
428428

429429
}
430+
431+
// verifyDeploymentImagePullPolicy checks if all containers in a deployment have the expected imagePullPolicy
432+
func VerifyDeploymentImagePullPolicy(name, namespace string, expectedPolicy corev1.PullPolicy, depl *appsv1.Deployment) func() bool {
433+
return func() bool {
434+
depl := &appsv1.Deployment{}
435+
k8sClient, _ := utils.GetE2ETestKubeClient()
436+
err := k8sClient.Get(context.Background(), client.ObjectKey{Name: name, Namespace: namespace}, depl)
437+
if err != nil {
438+
return false
439+
}
440+
if len(depl.Spec.Template.Spec.Containers) == 0 {
441+
return false
442+
}
443+
for _, container := range depl.Spec.Template.Spec.Containers {
444+
if container.ImagePullPolicy != expectedPolicy {
445+
return false
446+
}
447+
}
448+
return true
449+
}
450+
}

test/openshift/e2e/ginkgo/fixture/statefulset/fixture.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,23 @@ func fetchStatefulSet(f func(*appsv1.StatefulSet) bool) matcher.GomegaMatcher {
280280
}, BeTrue())
281281

282282
}
283+
284+
// verifyStatefulSetImagePullPolicy checks if all containers in a statefulset have the expected imagePullPolicy
285+
func VerifyStatefulSetImagePullPolicy(name, namespace string, expectedPolicy corev1.PullPolicy, ss *appsv1.StatefulSet) func() bool {
286+
return func() bool {
287+
k8sClient, _ := utils.GetE2ETestKubeClient()
288+
err := k8sClient.Get(context.Background(), client.ObjectKey{Name: name, Namespace: namespace}, ss)
289+
if err != nil {
290+
return false
291+
}
292+
if len(ss.Spec.Template.Spec.Containers) == 0 {
293+
return false
294+
}
295+
for _, container := range ss.Spec.Template.Spec.Containers {
296+
if container.ImagePullPolicy != expectedPolicy {
297+
return false
298+
}
299+
}
300+
return true
301+
}
302+
}

0 commit comments

Comments
 (0)