Skip to content

Commit 575bbb7

Browse files
author
E2E Test Bot
committed
Update tests for v1.20
1 parent 0330232 commit 575bbb7

3 files changed

Lines changed: 42 additions & 21 deletions

File tree

test/openshift/e2e/ginkgo/parallel/1-121_validate_image_updater_test.go

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
8686
output, err := osFixture.ExecCommand("oc", "auth", "can-i", "use", "scc/anyuid", "--as", serviceAccountUser)
8787
hasPermission := false
8888
if err == nil && len(output) > 0 {
89-
// Check if the service account user is already in the users list
90-
// Remove quotes and whitespace for comparison
9189
output = strings.TrimSpace(strings.Trim(output, "'\""))
9290
if strings.Contains(output, serviceAccountUser) {
9391
hasPermission = true
@@ -146,6 +144,12 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
146144
RepoURL: "https://github.com/argoproj-labs/argocd-image-updater/",
147145
Path: "test/e2e/testdata/005-public-guestbook",
148146
TargetRevision: "HEAD",
147+
// multi-arch image
148+
Kustomize: &appv1alpha1.ApplicationSourceKustomize{
149+
Images: appv1alpha1.KustomizeImages{
150+
"quay.io/dkarpele/my-guestbook=quay.io/prometheus/node-exporter:v1.6.0",
151+
},
152+
},
149153
},
150154
Destination: appv1alpha1.ApplicationDestination{
151155
Server: "https://kubernetes.default.svc",
@@ -175,8 +179,9 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
175179
NamePattern: "app*",
176180
Images: []imageUpdaterApi.ImageConfig{
177181
{
178-
Alias: "guestbook",
179-
ImageName: "quay.io/dkarpele/my-guestbook:~29437546.0",
182+
Alias: "guestbook",
183+
// Watch for the v1.7.x bumps
184+
ImageName: "quay.io/prometheus/node-exporter:~v1.7.0",
180185
CommonUpdateSettings: &imageUpdaterApi.CommonUpdateSettings{
181186
UpdateStrategy: &updateStrategy,
182187
},
@@ -188,7 +193,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
188193
}
189194
Expect(k8sClient.Create(ctx, imageUpdater)).To(Succeed())
190195

191-
By("ensuring that the Application image has `29437546.0` version after update")
196+
By("ensuring that the Application image has been updated by Image Updater")
192197
Eventually(func() string {
193198
err := k8sClient.Get(ctx, client.ObjectKeyFromObject(app), app)
194199

@@ -197,17 +202,19 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
197202
return "" // Let Eventually retry on error
198203
}
199204

200-
// Nil-safe check: The Kustomize block is only added by the Image Updater after its first run.
201-
// We must check that it and its Images field exist before trying to access them.
202205
if app.Spec.Source.Kustomize != nil && len(app.Spec.Source.Kustomize.Images) > 0 {
203-
imageStr := string(app.Spec.Source.Kustomize.Images[0])
204-
GinkgoWriter.Printf("Found Kustomize image: %s\n", imageStr)
206+
// Join all images to handle any appending behaviors
207+
var allImages []string
208+
for _, img := range app.Spec.Source.Kustomize.Images {
209+
allImages = append(allImages, string(img))
210+
}
211+
imageStr := strings.Join(allImages, ", ")
212+
GinkgoWriter.Printf("Found Kustomize image string: %s\n", imageStr)
205213
return imageStr
206214
}
207215

208-
// Return an empty string to signify the condition is not yet met.
209216
return ""
210-
}, "10m", "10s").Should(Equal("quay.io/dkarpele/my-guestbook:29437546.0"), "Image Updater did not update the Application image within timeout")
217+
}, "10m", "10s").Should(ContainSubstring("v1.7."), "Image Updater did not update the Application image within timeout")
211218
})
212219
})
213220
})

test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,14 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
355355

356356
container := deploymentFixture.GetTemplateSpecContainerByName(argoCDAgentPrincipalName, *principalDeployment)
357357
Expect(container).ToNot(BeNil())
358-
Expect(container.Image).To(Equal(common.ArgoCDAgentPrincipalDefaultImageName))
358+
359+
if fixture.RunningOnOpenShift() {
360+
// downstream
361+
Expect(container.Image).To(ContainSubstring("argocd-agent-rhel9"))
362+
} else {
363+
// Upstream
364+
Expect(container.Image).To(Equal(common.ArgoCDAgentPrincipalDefaultImageName))
365+
}
359366

360367
By("Create required secrets and certificates for principal pod to start properly")
361368

@@ -405,7 +412,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
405412

406413
By("Create ArgoCD instance")
407414

408-
argoCD.Spec.ArgoCDAgent.Principal.Image = "quay.io/argoprojlabs/argocd-agent:v0.5.0"
415+
argoCD.Spec.ArgoCDAgent.Principal.Image = "quay.io/argoprojlabs/argocd-agent:v0.5.1"
409416
Expect(k8sClient.Create(ctx, argoCD)).To(Succeed())
410417

411418
By("Verify expected resources are created for principal pod")
@@ -416,7 +423,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
416423

417424
container := deploymentFixture.GetTemplateSpecContainerByName(argoCDAgentPrincipalName, *principalDeployment)
418425
Expect(container).ToNot(BeNil())
419-
Expect(container.Image).To(Equal("quay.io/argoprojlabs/argocd-agent:v0.5.0"))
426+
Expect(container.Image).To(Equal("quay.io/argoprojlabs/argocd-agent:v0.5.1"))
420427

421428
By("Verify environment variables are set correctly")
422429

@@ -435,7 +442,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
435442
ac.Spec.ArgoCDAgent.Principal.LogFormat = "json"
436443
ac.Spec.ArgoCDAgent.Principal.Server.KeepAliveMinInterval = "60s"
437444
ac.Spec.ArgoCDAgent.Principal.Server.EnableWebSocket = ptr.To(true)
438-
ac.Spec.ArgoCDAgent.Principal.Image = "quay.io/argoprojlabs/argocd-agent:v0.5.1"
445+
ac.Spec.ArgoCDAgent.Principal.Image = "quay.io/argoprojlabs/argocd-agent:v0.6.0"
439446

440447
ac.Spec.ArgoCDAgent.Principal.Namespace.AllowedNamespaces = []string{"agent-managed", "agent-autonomous"}
441448
ac.Spec.ArgoCDAgent.Principal.Namespace.EnableNamespaceCreate = ptr.To(true)
@@ -482,7 +489,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
482489
if container == nil {
483490
return false
484491
}
485-
return container.Image == "quay.io/argoprojlabs/argocd-agent:v0.5.1"
492+
return container.Image == "quay.io/argoprojlabs/argocd-agent:v0.6.0"
486493
}, "120s", "5s").Should(BeTrue(), "Principal deployment should have the updated image")
487494

488495
By("verify that deployment is in Ready state")

test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,14 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
338338

339339
container := deploymentFixture.GetTemplateSpecContainerByName(argoCDAgentAgentName, *agentDeployment)
340340
Expect(container).ToNot(BeNil())
341-
Expect(container.Image).To(Equal(common.ArgoCDAgentAgentDefaultImageName))
341+
342+
if fixture.RunningOnOpenShift() {
343+
// downstream
344+
Expect(container.Image).To(ContainSubstring("argocd-agent-rhel9"))
345+
} else {
346+
// Upstream
347+
Expect(container.Image).To(Equal("quay.io/argoprojlabs/argocd-agent:v0.7.0"))
348+
}
342349

343350
By("Verify environment variables are set correctly")
344351

@@ -372,7 +379,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
372379

373380
By("Create ArgoCD instance")
374381

375-
argoCD.Spec.ArgoCDAgent.Agent.Image = "quay.io/argoprojlabs/argocd-agent:v0.5.0"
382+
argoCD.Spec.ArgoCDAgent.Agent.Image = "quay.io/argoprojlabs/argocd-agent:v0.5.1"
376383
Expect(k8sClient.Create(ctx, argoCD)).To(Succeed())
377384

378385
By("Verify expected resources are created for agent pod")
@@ -383,7 +390,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
383390

384391
container := deploymentFixture.GetTemplateSpecContainerByName(argoCDAgentAgentName, *agentDeployment)
385392
Expect(container).ToNot(BeNil())
386-
Expect(container.Image).To(Equal("quay.io/argoprojlabs/argocd-agent:v0.5.0"))
393+
Expect(container.Image).To(Equal("quay.io/argoprojlabs/argocd-agent:v0.5.1"))
387394

388395
By("Verify environment variables are set correctly")
389396

@@ -400,7 +407,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
400407

401408
ac.Spec.ArgoCDAgent.Agent.LogLevel = "trace"
402409
ac.Spec.ArgoCDAgent.Agent.LogFormat = "json"
403-
ac.Spec.ArgoCDAgent.Agent.Image = "quay.io/argoprojlabs/argocd-agent:v0.5.1"
410+
ac.Spec.ArgoCDAgent.Agent.Image = "quay.io/argoprojlabs/argocd-agent:v0.6.0"
404411

405412
ac.Spec.ArgoCDAgent.Agent.Client.KeepAliveInterval = "60s"
406413
ac.Spec.ArgoCDAgent.Agent.Client.EnableWebSocket = ptr.To(true)
@@ -430,7 +437,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
430437
if container == nil {
431438
return false
432439
}
433-
return container.Image == "quay.io/argoprojlabs/argocd-agent:v0.5.1"
440+
return container.Image == "quay.io/argoprojlabs/argocd-agent:v0.6.0"
434441
}, "120s", "5s").Should(BeTrue(), "Agent deployment should have the updated image")
435442

436443
By("Verify environment variables are updated correctly")

0 commit comments

Comments
 (0)