Skip to content

Commit 9a05e42

Browse files
authored
Update to argocd-operator commit '258914335b862f44a0e27e44e0ed3b3bbb69c3b0' (#1021)
Signed-off-by: Jonathan West <jonwest@redhat.com>
1 parent 0755156 commit 9a05e42

14 files changed

+595
-77
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ build: generate fmt vet ## Build manager binary.
211211

212212
.PHONY: run
213213
run: manifests generate fmt vet ## Run a controller from your host.
214-
CLUSTER_SCOPED_ARGO_ROLLOUTS_NAMESPACES=argo-rollouts,test-rom-ns-1,rom-ns-1,openshift-gitops ARGOCD_CLUSTER_CONFIG_NAMESPACES=openshift-gitops REDIS_CONFIG_PATH="build/redis" go run ./cmd/main.go
214+
CLUSTER_SCOPED_ARGO_ROLLOUTS_NAMESPACES=argo-rollouts,test-rom-ns-1,rom-ns-1,openshift-gitops ARGOCD_CLUSTER_CONFIG_NAMESPACES="openshift-gitops, argocd-e2e-cluster-config, argocd-test-impersonation-1-046, argocd-agent-principal-1-051, argocd-agent-agent-1-052, appset-argocd, appset-old-ns, appset-new-ns" REDIS_CONFIG_PATH="build/redis" go run ./cmd/main.go
215215

216216
.PHONY: docker-build
217217
docker-build: test ## Build container image with the manager.

controllers/argocd/openshift/openshift_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,10 @@ func TestAdminClusterRoleMapper(t *testing.T) {
306306

307307
// Sort both slices to ensure consistent comparison
308308
sort.Slice(result, func(i, j int) bool {
309-
return result[i].NamespacedName.Name < result[j].NamespacedName.Name
309+
return result[i].Name < result[j].Name
310310
})
311311
sort.Slice(expectedRequests, func(i, j int) bool {
312-
return expectedRequests[i].NamespacedName.Name < expectedRequests[j].NamespacedName.Name
312+
return expectedRequests[i].Name < expectedRequests[j].Name
313313
})
314314

315315
assert.Equal(t, expectedRequests, result)

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.20251105123110-0c547c7a7765
7-
github.com/argoproj-labs/argocd-operator v0.0.0-20251125104336-a68322dd72f3
7+
github.com/argoproj-labs/argocd-operator v0.17.0-rc1.0.20251203145554-258914335b86
88
github.com/argoproj/argo-cd/v3 v3.1.9
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.20251105123110-0c547c7a7765 h1:zVN+W/nQrRB/kB63YcvcCseuiE//sEzNw6Oa8rqiFOs=
3333
github.com/argoproj-labs/argo-rollouts-manager v0.0.7-0.20251105123110-0c547c7a7765/go.mod h1:WPyZkNHZjir/OTt8mrRwcUZKe1euHrHPJsRv1Wp/F/0=
34-
github.com/argoproj-labs/argocd-operator v0.0.0-20251125104336-a68322dd72f3 h1:rhNi/GnlHjJWyE3ivayCSDZfvRvoxUgHoH2sEgTuyv4=
35-
github.com/argoproj-labs/argocd-operator v0.0.0-20251125104336-a68322dd72f3/go.mod h1:tugRb82zAQXSsQfogeBkNUfl5ffdPAAD5nk/9eRAUC8=
34+
github.com/argoproj-labs/argocd-operator v0.17.0-rc1.0.20251203145554-258914335b86 h1:crfiDUoEdB1wDUZCpo6Q4rQZmEoFqsrS5swvckM3OUw=
35+
github.com/argoproj-labs/argocd-operator v0.17.0-rc1.0.20251203145554-258914335b86/go.mod h1:JUvpFGuOdBL23437e/IdBsdwUE+69J6LzKQ2Q42ycc0=
3636
github.com/argoproj/argo-cd/v3 v3.1.9 h1:9P9vJKo1RGWu6mtQnGu61r+0h3XKlA2j3kVhwogUQ/0=
3737
github.com/argoproj/argo-cd/v3 v3.1.9/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/fixture.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,17 @@ func OutputDebugOnFail(namespaceParams ...any) {
881881
GinkgoWriter.Println(kubectlOutput)
882882
GinkgoWriter.Println("----------------------------------------------------------------")
883883

884+
kubectlOutput, err = osFixture.ExecCommandWithOutputParam(false, "kubectl", "get", "events", "-n", namespace)
885+
if err != nil {
886+
GinkgoWriter.Println("unable to get events for namespace", err, kubectlOutput)
887+
} else {
888+
GinkgoWriter.Println("")
889+
GinkgoWriter.Println("----------------------------------------------------------------")
890+
GinkgoWriter.Println("'kubectl get events -n " + namespace + ":")
891+
GinkgoWriter.Println(kubectlOutput)
892+
GinkgoWriter.Println("----------------------------------------------------------------")
893+
}
894+
884895
}
885896

886897
kubectlOutput, err := osFixture.ExecCommandWithOutputParam(false, "kubectl", "get", "argocds", "-A", "-o", "yaml")
@@ -894,6 +905,8 @@ func OutputDebugOnFail(namespaceParams ...any) {
894905
GinkgoWriter.Println("----------------------------------------------------------------")
895906
}
896907

908+
GinkgoWriter.Println("You can skip this debug output by setting 'SKIP_DEBUG_OUTPUT=true'")
909+
897910
}
898911

899912
// EnsureRunningOnOpenShift should be called if a test requires OpenShift (for example, it uses Route CR).

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ func NotHaveLabelWithValue(key string, value string) matcher.GomegaMatcher {
9090
return true
9191
}
9292

93+
GinkgoWriter.Println("NotHaveLabelWithValue: not expected: ", key, "/", value, ". actual:", labels[key])
94+
9395
return labels[key] != value
9496

9597
}, BeTrue())

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ func HaveDataKeyValue(key string, value []byte) matcher.GomegaMatcher {
9898

9999
}
100100

101+
// NotHaveDataKey returns true if Secret's .data 'key' does not exist, false otherwise
102+
func NotHaveDataKey(key string) matcher.GomegaMatcher {
103+
return fetchSecret(func(secret *corev1.Secret) bool {
104+
_, exists := secret.Data[key]
105+
GinkgoWriter.Println("NotHaveDataKey - key:", key, "Exists:", exists)
106+
return !exists
107+
})
108+
109+
}
110+
101111
// This is intentionally NOT exported, for now. Create another function in this file/package that calls this function, and export that.
102112
func fetchSecret(f func(*corev1.Secret) bool) matcher.GomegaMatcher {
103113

test/openshift/e2e/ginkgo/parallel/1-042_restricted_pss_compliant_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
5858
defer fixture.DeleteNamespace(ns)
5959

6060
fixture.OutputDebugOnFail(ns.Name)
61+
6162
})
6263

6364
It("verifies that all Argo CD components can run with pod-security enforce, warn, and audit of 'restricted'", func() {

test/openshift/e2e/ginkgo/parallel/1-055_validate_notification_controller_test.go

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,76 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
171171

172172
})
173173

174+
It("ensure that sourceNamespace resources are not created for namespace-scoped instance", func() {
175+
176+
By("creating test namespaces")
177+
fooNs, fooNsCleanupFunc := fixture.CreateNamespaceWithCleanupFunc("foo-src-ns")
178+
defer fooNsCleanupFunc()
179+
180+
By("creating namespace-scoped Argo CD instance with sourceNamespaces")
181+
ns, cleanupFunc := fixture.CreateNamespaceWithCleanupFunc("1-055-src-ns-test")
182+
defer cleanupFunc()
183+
184+
argocd := &argov1beta1api.ArgoCD{
185+
ObjectMeta: metav1.ObjectMeta{
186+
Name: "example-argocd",
187+
Namespace: ns.Name,
188+
},
189+
Spec: argov1beta1api.ArgoCDSpec{
190+
Notifications: argov1beta1api.ArgoCDNotifications{
191+
Enabled: true,
192+
SourceNamespaces: []string{fooNs.Name},
193+
},
194+
SourceNamespaces: []string{fooNs.Name},
195+
},
196+
}
197+
Expect(k8sClient.Create(ctx, argocd)).To(Succeed())
198+
199+
By("verifying Argo CD and notification controller start as expected")
200+
Eventually(argocd, "4m", "5s").Should(argocdFixture.HaveNotificationControllerStatus("Running"))
201+
202+
By("verifying that sourceNamespace cmd args don't exist")
203+
depl := &appsv1.Deployment{
204+
ObjectMeta: metav1.ObjectMeta{
205+
Name: "example-argocd-notifications-controller",
206+
Namespace: ns.Name,
207+
},
208+
}
209+
Eventually(depl).Should(k8sFixture.ExistByName())
210+
// TODO: add check to test "--application-namespaces" cmd arg is not present in the notification deployment container args
211+
212+
By("verifying sourceNamespace rbac resources are not created")
213+
clusterRole := &rbacv1.ClusterRole{
214+
ObjectMeta: metav1.ObjectMeta{
215+
Name: "example-argocd-1-055-src-ns-test-argocd-notifications-controller",
216+
Namespace: ns.Name,
217+
},
218+
}
219+
clusterRoleBinding := &rbacv1.ClusterRoleBinding{
220+
ObjectMeta: metav1.ObjectMeta{
221+
Name: "example-argocd-1-055-src-ns-test-argocd-notifications-controller",
222+
Namespace: ns.Name,
223+
},
224+
}
225+
role := &rbacv1.Role{
226+
ObjectMeta: metav1.ObjectMeta{
227+
Name: "example-argocd-1-055-src-ns-test-notifications",
228+
Namespace: fooNs.Name,
229+
},
230+
}
231+
roleBinding := &rbacv1.RoleBinding{
232+
ObjectMeta: metav1.ObjectMeta{
233+
Name: "example-argocd-1-055-src-ns-test-notifications",
234+
Namespace: fooNs.Name,
235+
},
236+
}
237+
238+
Eventually(role).Should(k8sFixture.NotExistByName())
239+
Eventually(roleBinding).Should(k8sFixture.NotExistByName())
240+
Eventually(clusterRole).Should(k8sFixture.NotExistByName())
241+
Eventually(clusterRoleBinding).Should(k8sFixture.NotExistByName())
242+
243+
})
244+
174245
})
175246
})

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
7676
By("updating RolloutManager spec")
7777

7878
// Add a new label to trigger reconciliation
79-
if rolloutManager.ObjectMeta.Labels == nil {
80-
rolloutManager.ObjectMeta.Labels = make(map[string]string)
79+
if rolloutManager.Labels == nil {
80+
rolloutManager.Labels = make(map[string]string)
8181
}
82-
rolloutManager.ObjectMeta.Labels["test-update"] = "true"
82+
rolloutManager.Labels["test-update"] = "true"
8383
patch := client.MergeFrom(rolloutManager.DeepCopy())
8484
Expect(k8sClient.Patch(ctx, rolloutManager, patch)).To(Succeed())
8585

0 commit comments

Comments
 (0)