Skip to content

Commit e315ccf

Browse files
committed
chore: update to argocd-operator '76739d532c1d4f27c1bb2be18c743d97d41a14fd'
Signed-off-by: Jonathan West <jonwest@redhat.com>
1 parent 3d260ac commit e315ccf

File tree

9 files changed

+528
-71
lines changed

9 files changed

+528
-71
lines changed

Makefile

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

204204
.PHONY: run
205205
run: manifests generate fmt vet ## Run a controller from your host.
206-
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
206+
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
207207

208208
.PHONY: docker-build
209209
docker-build: test ## Build docker image with the manager.

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.6-0.20250625125608-ebd6207c8bb1
7-
github.com/argoproj-labs/argocd-operator v0.0.0-20251125121734-d31c354add55
7+
github.com/argoproj-labs/argocd-operator v0.15.1-0.20251204065549-76739d532c1d
88
github.com/argoproj/argo-cd/v3 v3.0.16
99
github.com/argoproj/gitops-engine v0.7.1-0.20250905153922-d96c3d51e4c4
1010
github.com/go-logr/logr v1.4.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFI
3535
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
3636
github.com/argoproj-labs/argo-rollouts-manager v0.0.6-0.20250625125608-ebd6207c8bb1 h1:TjX3ZHPA3YOmoHZutzfvOQVKRO2Jt4JvDCPvI4VhWoA=
3737
github.com/argoproj-labs/argo-rollouts-manager v0.0.6-0.20250625125608-ebd6207c8bb1/go.mod h1:yTwzKUV79YyI764hkXdVojGYBA9yKJk3qXx5mRuQ2Xc=
38-
github.com/argoproj-labs/argocd-operator v0.0.0-20251125121734-d31c354add55 h1:ew6ysNJ88wvYHnnzxyO2mawuCDghuN0REhgOSaknKNA=
39-
github.com/argoproj-labs/argocd-operator v0.0.0-20251125121734-d31c354add55/go.mod h1:FnNg+8MBzJeXD5QtfEwesgMhGwDqp1Oa92T4dVJCT9g=
38+
github.com/argoproj-labs/argocd-operator v0.15.1-0.20251204065549-76739d532c1d h1:Zzq4rCBW9irP2WeP/QWQK9vppKPNoQDPvJwF/30wepI=
39+
github.com/argoproj-labs/argocd-operator v0.15.1-0.20251204065549-76739d532c1d/go.mod h1:FnNg+8MBzJeXD5QtfEwesgMhGwDqp1Oa92T4dVJCT9g=
4040
github.com/argoproj/argo-cd/v3 v3.0.16 h1:V67eJxuPTS20kjcA1K/uLnbapEVUfIJ9eIO62ns4ECU=
4141
github.com/argoproj/argo-cd/v3 v3.0.16/go.mod h1:oTCI5r+Hacij94yJto2/mVXAHB8r3375h9SInqbS8EM=
4242
github.com/argoproj/gitops-engine v0.7.1-0.20250905153922-d96c3d51e4c4 h1:OsQxWX8UHdwXuy72Y1Js8gQY3xmOzFEieCSpMoXKFb8=

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,29 @@ func OutputDebugOnFail(namespaceParams ...any) {
872872
GinkgoWriter.Println(kubectlOutput)
873873
GinkgoWriter.Println("----------------------------------------------------------------")
874874

875+
kubectlOutput, err = osFixture.ExecCommandWithOutputParam(false, "kubectl", "get", "deployments", "-n", namespace, "-o", "yaml")
876+
if err != nil {
877+
GinkgoWriter.Println("unable to list", namespace, err, kubectlOutput)
878+
continue
879+
}
880+
881+
GinkgoWriter.Println("")
882+
GinkgoWriter.Println("----------------------------------------------------------------")
883+
GinkgoWriter.Println("'kubectl get deployments -n " + namespace + " -o yaml")
884+
GinkgoWriter.Println(kubectlOutput)
885+
GinkgoWriter.Println("----------------------------------------------------------------")
886+
887+
kubectlOutput, err = osFixture.ExecCommandWithOutputParam(false, "kubectl", "get", "events", "-n", namespace)
888+
if err != nil {
889+
GinkgoWriter.Println("unable to get events for namespace", err, kubectlOutput)
890+
} else {
891+
GinkgoWriter.Println("")
892+
GinkgoWriter.Println("----------------------------------------------------------------")
893+
GinkgoWriter.Println("'kubectl get events -n " + namespace + ":")
894+
GinkgoWriter.Println(kubectlOutput)
895+
GinkgoWriter.Println("----------------------------------------------------------------")
896+
}
897+
875898
}
876899

877900
kubectlOutput, err := osFixture.ExecCommandWithOutputParam(false, "kubectl", "get", "argocds", "-A", "-o", "yaml")
@@ -885,6 +908,8 @@ func OutputDebugOnFail(namespaceParams ...any) {
885908
GinkgoWriter.Println("----------------------------------------------------------------")
886909
}
887910

911+
GinkgoWriter.Println("You can skip this debug output by setting 'SKIP_DEBUG_OUTPUT=true'")
912+
888913
}
889914

890915
func outputPodLog(podSubstring string) {

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

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

91+
GinkgoWriter.Println("NotHaveLabelWithValue: not expected: ", key, "/", value, ". actual:", labels[key])
92+
9193
return labels[key] != value
9294

9395
}, BeTrue())

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

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

8181
}
8282

83+
// NotHaveDataKey returns true if Secret's .data 'key' does not exist, false otherwise
84+
func NotHaveDataKey(key string) matcher.GomegaMatcher {
85+
return fetchSecret(func(secret *corev1.Secret) bool {
86+
_, exists := secret.Data[key]
87+
GinkgoWriter.Println("NotHaveDataKey - key:", key, "Exists:", exists)
88+
return !exists
89+
})
90+
91+
}
92+
8393
// This is intentionally NOT exported, for now. Create another function in this file/package that calls this function, and export that.
8494
func fetchSecret(f func(*corev1.Secret) bool) matcher.GomegaMatcher {
8595

test/openshift/e2e/ginkgo/sequential/1-036_validate_role_rolebinding_for_source_namespace_test.go

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import (
1212
namespaceFixture "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/namespace"
1313
"github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/utils"
1414

15+
corev1 "k8s.io/api/core/v1"
1516
rbacv1 "k8s.io/api/rbac/v1"
17+
apierrors "k8s.io/apimachinery/pkg/api/errors"
1618
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1719
"sigs.k8s.io/controller-runtime/pkg/client"
1820
)
@@ -22,8 +24,10 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
2224
Context("1-036_validate_role_rolebinding_for_source_namespace", func() {
2325

2426
var (
25-
ctx context.Context
26-
k8sClient client.Client
27+
ctx context.Context
28+
k8sClient client.Client
29+
argoNamespace *corev1.Namespace
30+
cleanupArgoNSFunc func()
2731

2832
defaultNSArgoCD *v1beta1.ArgoCD
2933

@@ -39,30 +43,39 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
3943

4044
AfterEach(func() {
4145

42-
fixture.OutputDebugOnFail("default")
46+
fixture.OutputDebugOnFail(argoNamespace)
47+
48+
// Clean up argo cd instance created in test namespace first (before deleting the namespace itself)
49+
Expect(defaultNSArgoCD).ToNot(BeNil())
50+
err := k8sClient.Delete(ctx, defaultNSArgoCD)
51+
if err != nil && !apierrors.IsNotFound(err) {
52+
Expect(err).ToNot(HaveOccurred())
53+
}
4354

4455
// Clean up namespaces created
4556
for _, namespaceCleanupFunction := range cleanupFunctions {
4657
namespaceCleanupFunction()
4758
}
4859

49-
// Clean up argo cd instance created in 'default' NS
50-
Expect(defaultNSArgoCD).ToNot(BeNil())
51-
Expect(k8sClient.Delete(ctx, defaultNSArgoCD)).To(Succeed())
52-
5360
})
5461

5562
It("verifies that ArgoCD CR '.spec.sourceNamespaces' field wildcard-matching matches and manages only namespaces which match the wildcard", func() {
5663

64+
fixture.SetEnvInOperatorSubscriptionOrDeployment("ARGOCD_CLUSTER_CONFIG_NAMESPACES", "openshift-gitops, argocd-e2e-cluster-config")
65+
66+
By("creating cluster-scoped namespace for Argo CD instance")
67+
argoNamespace, cleanupArgoNSFunc = fixture.CreateNamespaceWithCleanupFunc("argocd-e2e-cluster-config")
68+
cleanupFunctions = append(cleanupFunctions, cleanupArgoNSFunc)
69+
5770
By("creating test NS")
5871
testNS, cleanupFunc := fixture.CreateNamespaceWithCleanupFunc("test")
5972
cleanupFunctions = append(cleanupFunctions, cleanupFunc)
6073

61-
By("creating Argo CD instance in default NS, with 'test' sourceNamespace only")
74+
By("creating Argo CD instance in argocd-e2e-cluster-config NS, with 'test' sourceNamespace only")
6275
defaultNSArgoCD = &v1beta1.ArgoCD{
6376
ObjectMeta: metav1.ObjectMeta{
6477
Name: "example-argocd",
65-
Namespace: "default",
78+
Namespace: argoNamespace.Name,
6679
},
6780
Spec: v1beta1.ArgoCDSpec{
6881
SourceNamespaces: []string{
@@ -73,7 +86,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
7386
Expect(k8sClient.Create(ctx, defaultNSArgoCD)).To(Succeed())
7487

7588
By("verifying Argo CD instance starts managing the namespace via managed-by-cluster-argocd label")
76-
Eventually(testNS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
89+
Eventually(testNS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
7790

7891
expectRoleAndRoleBindingValues := func(name string, ns string) {
7992

@@ -107,12 +120,12 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
107120
{
108121
Kind: "ServiceAccount",
109122
Name: "example-argocd-argocd-server",
110-
Namespace: "default",
123+
Namespace: argoNamespace.Name,
111124
},
112125
{
113126
Kind: "ServiceAccount",
114127
Name: "example-argocd-argocd-application-controller",
115-
Namespace: "default",
128+
Namespace: argoNamespace.Name,
116129
},
117130
}))
118131

@@ -133,7 +146,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
133146
})
134147

135148
By("verifying test-1 NS becomes managed, and expected role/rolebindings exist in test* namespaces but not dev")
136-
Eventually(test1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
149+
Eventually(test1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
137150

138151
expectRoleAndRoleBindingValues("example-argocd_test", "test")
139152

@@ -161,7 +174,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
161174
cleanupFunctions = append(cleanupFunctions, cleanupFunc)
162175

163176
By("verifying the test-2 namespace becomes managed by the argo cd instance, and has the expected role/rolebinding")
164-
Eventually(test2NS, "2m", "5s").Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
177+
Eventually(test2NS, "2m", "5s").Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
165178

166179
expectRoleAndRoleBindingValues("example-argocd_test-2", "test-2")
167180

@@ -173,17 +186,17 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
173186
})
174187

175188
By("verifying test, test-1, test-2, and dev are all managed and have the expected roles")
176-
Eventually(testNS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
177-
Consistently(testNS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
189+
Eventually(testNS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
190+
Consistently(testNS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
178191

179-
Eventually(test1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
180-
Consistently(test1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
192+
Eventually(test1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
193+
Consistently(test1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
181194

182-
Eventually(test2NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
183-
Consistently(test2NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
195+
Eventually(test2NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
196+
Consistently(test2NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
184197

185-
Eventually(devNS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
186-
Consistently(devNS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
198+
Eventually(devNS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
199+
Consistently(devNS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
187200

188201
expectRoleAndRoleBindingValues("example-argocd_test", "test")
189202
expectRoleAndRoleBindingValues("example-argocd_test-1", "test-1")
@@ -208,11 +221,11 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
208221
cleanupFunctions = append(cleanupFunctions, cleanupFunc)
209222

210223
By("verifying test-ns-1 and dev-ns-1 are managed, but other-ns isn't")
211-
Eventually(test_ns_1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
212-
Consistently(test_ns_1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
224+
Eventually(test_ns_1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
225+
Consistently(test_ns_1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
213226

214-
Eventually(dev_ns_1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
215-
Consistently(dev_ns_1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
227+
Eventually(dev_ns_1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
228+
Consistently(dev_ns_1NS).Should(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
216229

217230
expectRoleAndRoleBindingValues("example-argocd_test-ns-1", "test-ns-1")
218231
expectRoleAndRoleBindingValues("example-argocd_dev-ns-1", "dev-ns-1")
@@ -239,18 +252,18 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
239252
})
240253

241254
By("verifying dev-ns-1 eventually becomes unmanaged")
242-
Eventually(dev_ns_1NS).ShouldNot(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
243-
Consistently(dev_ns_1NS).ShouldNot(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", "default"))
255+
Eventually(dev_ns_1NS).ShouldNot(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
256+
Consistently(dev_ns_1NS).ShouldNot(namespaceFixture.HaveLabel("argocd.argoproj.io/managed-by-cluster-argocd", argoNamespace.Name))
244257

245258
devns1Role := &rbacv1.Role{
246259
ObjectMeta: metav1.ObjectMeta{
247-
Name: " example-argocd_dev-ns-1",
260+
Name: "example-argocd_dev-ns-1",
248261
Namespace: dev_ns_1NS.Name,
249262
},
250263
}
251264
devns1RoleBinding := &rbacv1.RoleBinding{
252265
ObjectMeta: metav1.ObjectMeta{
253-
Name: " example-argocd_dev-ns-1",
266+
Name: "example-argocd_dev-ns-1",
254267
Namespace: dev_ns_1NS.Name,
255268
},
256269
}

0 commit comments

Comments
 (0)