Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
660 changes: 638 additions & 22 deletions bundle/manifests/argoproj.io_argocds.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ metadata:
capabilities: Deep Insights
console.openshift.io/plugins: '["gitops-plugin"]'
containerImage: quay.io/redhat-developer/gitops-operator
createdAt: "2026-06-11T15:05:37Z"
createdAt: "2026-06-16T17:25:03Z"
description: Enables teams to adopt GitOps principles for managing cluster configurations
and application delivery across hybrid multi-cluster Kubernetes environments.
features.operators.openshift.io/disconnected: "true"
Expand Down
660 changes: 638 additions & 22 deletions config/crd/bases/argoproj.io_argocds.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,64 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
}).Should(BeTrue())

})

It("verifies that the deprecated spec.logformat field is honoured for applicationSet and notifications", func() {
By("creating a fresh test namespace")
ns, cleanupFunc = fixture.CreateRandomE2ETestNamespaceWithCleanupFunc()

By("creating ArgoCD CR using the deprecated lowercase logformat field on applicationSet and notifications")

argoCD := &argov1beta1api.ArgoCD{
ObjectMeta: metav1.ObjectMeta{Name: "argocd", Namespace: ns.Name},
Spec: argov1beta1api.ArgoCDSpec{
Server: argov1beta1api.ArgoCDServerSpec{
Route: argov1beta1api.ArgoCDRouteSpec{Enabled: true},
},
ApplicationSet: &argov1beta1api.ArgoCDApplicationSet{
//nolint:staticcheck // intentionally using deprecated field to verify backward compatibility in e2e
Logformat: "json",
},
Notifications: argov1beta1api.ArgoCDNotifications{
Enabled: true,
//nolint:staticcheck // intentionally using deprecated field to verify backward compatibility in e2e
Logformat: "json",
},
},
}
Expect(k8sClient.Create(ctx, argoCD)).To(Succeed())

By("waiting for the ArgoCD instance to become fully available")

Eventually(argoCD, "5m", "5s").Should(argocdFixture.BeAvailable())

deploymentCommandContains := func(deplName, flag, value string) bool {
depl := &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{Name: deplName, Namespace: ns.Name},
}
if err := k8sClient.Get(ctx, client.ObjectKeyFromObject(depl), depl); err != nil {
GinkgoWriter.Println("error fetching deployment", deplName, ":", err)
return false
}
if len(depl.Spec.Template.Spec.Containers) == 0 {
GinkgoWriter.Println("deployment", deplName, "has no containers yet")
return false
}
cmdStr := strings.Join(depl.Spec.Template.Spec.Containers[0].Command, " ")
GinkgoWriter.Println(deplName, "command:", cmdStr)

return strings.Contains(cmdStr, flag+" "+value)
}
By("verifying argocd-applicationset-controller Deployment has --logformat json from deprecated field")

Eventually(func() bool {
return deploymentCommandContains("argocd-applicationset-controller", "--logformat", "json")
}, "2m", "5s").Should(BeTrue())
By("verifying argocd-notifications-controller Deployment has --logformat json from deprecated field")

Eventually(func() bool {
return deploymentCommandContains("argocd-notifications-controller", "--logformat", "json")
}, "2m", "5s").Should(BeTrue())

})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture"
argocdFixture "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/argocd"
k8sFixture "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/k8s"
"github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/statefulset"
fixtureUtils "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/utils"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -94,6 +95,43 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
}
Expect(match).To(BeTrue(), "StatefulSet should have expected ARGOCD_CONTROLLER_REPLICAS")

By("ensuring algorithm can be set")
argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) {
ac.Spec.Controller.Sharding = argov1beta1api.ArgoCDApplicationControllerShardSpec{
Enabled: true,
Replicas: 3,
DistributionAlgorithm: "round-robin",
}
})

By("checking if ARGOCD_CONTROLLER_SHARDING_ALGORITHM env var is set in the app controller StatefulSet")
Eventually(statefulSet).Should(k8sFixture.ExistByName())
Eventually(statefulSet, "60s", "5s").Should(statefulset.HaveContainerWithEnvVar("ARGOCD_CONTROLLER_SHARDING_ALGORITHM", "round-robin", 0), "Statefulset should have expected ARGOCD_CONTROLLER_SHARDING_ALGORITHM to be round-robin")

By("unset algorithm and ensure that it is not set")
argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) {
ac.Spec.Controller.Sharding = argov1beta1api.ArgoCDApplicationControllerShardSpec{
Enabled: true,
Replicas: 3,
}
})

By("checking if ARGOCD_CONTROLLER_SHARDING_ALGORITHM env var is not set in app controller StatefulSet")
Eventually(statefulSet).Should(k8sFixture.ExistByName())
Eventually(func() bool {
if err := k8sClient.Get(ctx, client.ObjectKeyFromObject(statefulSet), statefulSet); err != nil {
return false
}
if len(statefulSet.Spec.Template.Spec.Containers) == 0 {
return false
}
for _, env := range statefulSet.Spec.Template.Spec.Containers[0].Env {
if env.Name == "ARGOCD_CONTROLLER_SHARDING_ALGORITHM" {
return false
}
}
return true
}, "60s", "5s").Should(BeTrue(), "StatefulSet should have no env variable named ARGOCD_CONTROLLER_SHARDING_ALGORITHM")
By("disabling sharding")
argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) {
ac.Spec.Controller.Sharding = argov1beta1api.ArgoCDApplicationControllerShardSpec{
Expand Down
Loading
Loading