diff --git a/internal/controller/auth_policy_status_updater.go b/internal/controller/auth_policy_status_updater.go index 7f4fc763d..43ca15495 100644 --- a/internal/controller/auth_policy_status_updater.go +++ b/internal/controller/auth_policy_status_updater.go @@ -213,6 +213,9 @@ func (r *AuthPolicyStatusUpdater) enforcedCondition(policy *kuadrantv1.AuthPolic } continue } + if gatewayClass.GetDeletionTimestamp() != nil || gateway.GetDeletionTimestamp() != nil || httpRoute.GetDeletionTimestamp() != nil { + continue + } if !kuadrantgatewayapi.IsListenerReady(listener.Listener, gateway.Gateway) || !kuadrantgatewayapi.IsHTTPRouteReady(httpRoute.HTTPRoute, gateway.Gateway, gatewayClass.Spec.ControllerName) { continue } @@ -220,11 +223,14 @@ func (r *AuthPolicyStatusUpdater) enforcedCondition(policy *kuadrantv1.AuthPolic if len(effectivePolicyRules) > 0 { for _, policyRuleKey := range policyRuleKeys { if effectivePolicyRule, ok := effectivePolicyRules[policyRuleKey]; !ok || (ok && effectivePolicyRule.GetSource() != policy.GetLocator()) { // policy rule has been overridden by another policy - var overriddenBy string - if ok { // TODO(guicassolato): !ok → we cannot tell which policy is overriding the rule, this information is lost when the policy rule is dropped during an atomic override - overriddenBy = effectivePolicyRule.GetSource() + if ok { + // Rule exists in effective policy but from a different source (rule-level override) + overridingPolicies[policyRuleKey] = append(overridingPolicies[policyRuleKey], effectivePolicyRule.GetSource()) + } else { + // Rule doesn't exist at all (atomic override) - the policies that contributed + // to the effective policy are the ones that overrode this policy + overridingPolicies[policyRuleKey] = append(overridingPolicies[policyRuleKey], effectivePolicy.SourcePolicies...) } - overridingPolicies[policyRuleKey] = append(overridingPolicies[policyRuleKey], overriddenBy) continue } // policy rule is in the effective policy, track the Gateway and the HTTPRouteRule affected by the policy diff --git a/internal/controller/ratelimit_policy_status_updater.go b/internal/controller/ratelimit_policy_status_updater.go index be5b16a14..578f41d5b 100644 --- a/internal/controller/ratelimit_policy_status_updater.go +++ b/internal/controller/ratelimit_policy_status_updater.go @@ -2,14 +2,14 @@ package controllers import ( "context" + "errors" "fmt" "slices" "strings" "sync" - "github.com/kuadrant/kuadrant-operator/internal/cel" - envoygatewayv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + "github.com/go-logr/logr" limitadorv1alpha1 "github.com/kuadrant/limitador-operator/api/v1alpha1" "github.com/kuadrant/policy-machinery/controller" "github.com/kuadrant/policy-machinery/machinery" @@ -27,6 +27,7 @@ import ( kuadrantv1 "github.com/kuadrant/kuadrant-operator/api/v1" kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1" + "github.com/kuadrant/kuadrant-operator/internal/cel" kuadrantenvoygateway "github.com/kuadrant/kuadrant-operator/internal/envoygateway" kuadrantgatewayapi "github.com/kuadrant/kuadrant-operator/internal/gatewayapi" kuadrantistio "github.com/kuadrant/kuadrant-operator/internal/istio" @@ -101,7 +102,7 @@ func (r *RateLimitPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []con if !accepted { meta.RemoveStatusCondition(&newStatus.Conditions, string(kuadrant.PolicyConditionEnforced)) } else { - enforcedCond := r.enforcedCondition(policy, topology, state) + enforcedCond := r.enforcedCondition(policy, topology, state, logger) meta.SetStatusCondition(&newStatus.Conditions, *enforcedCond) } @@ -150,7 +151,7 @@ func (r *RateLimitPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []con return nil } -func (r *RateLimitPolicyStatusUpdater) enforcedCondition(policy *kuadrantv1.RateLimitPolicy, topology *machinery.Topology, state *sync.Map) *metav1.Condition { +func (r *RateLimitPolicyStatusUpdater) enforcedCondition(policy *kuadrantv1.RateLimitPolicy, topology *machinery.Topology, state *sync.Map, logger logr.Logger) *metav1.Condition { kObj := GetKuadrantFromTopology(topology) if kObj == nil { return kuadrant.EnforcedCondition(policy, kuadrant.NewErrSystemResource("kuadrant"), false) @@ -193,18 +194,33 @@ func (r *RateLimitPolicyStatusUpdater) enforcedCondition(policy *kuadrantv1.Rate } } - gatewayClass, gateway, listener, httpRoute, _, _ := kuadrantpolicymachinery.ObjectsInRequestPath(effectivePolicy.Path) + gatewayClass, gateway, listener, httpRoute, _, err := kuadrantpolicymachinery.ObjectsInRequestPath(effectivePolicy.Path) + if err != nil { + if errors.As(err, &kuadrantpolicymachinery.ErrInvalidPath{}) { + logger.V(1).Info("skipping effectivePolicy for invalid path", "path", effectivePolicy.Path) + } else { + logger.Error(err, "unable to process effectivePolicy", "path", effectivePolicy.Path) + } + continue + } + + if gatewayClass.GetDeletionTimestamp() != nil || gateway.GetDeletionTimestamp() != nil || httpRoute.GetDeletionTimestamp() != nil { + continue + } if !kuadrantgatewayapi.IsListenerReady(listener.Listener, gateway.Gateway) || !kuadrantgatewayapi.IsHTTPRouteReady(httpRoute.HTTPRoute, gateway.Gateway, gatewayClass.Spec.ControllerName) { continue } effectivePolicyRules := effectivePolicy.Spec.Rules() for _, policyRuleKey := range policyRuleKeys { if effectivePolicyRule, ok := effectivePolicyRules[policyRuleKey]; !ok || (ok && effectivePolicyRule.GetSource() != policy.GetLocator()) { // policy rule has been overridden by another policy - var overriddenBy string - if ok { // TODO(guicassolato): !ok → we cannot tell which policy is overriding the rule, this information is lost when the policy rule is dropped during an atomic override - overriddenBy = effectivePolicyRule.GetSource() + if ok { + // Rule exists in effective policy but from a different source (rule-level override) + overridingPolicies[policyRuleKey] = append(overridingPolicies[policyRuleKey], effectivePolicyRule.GetSource()) + } else { + // Rule doesn't exist at all (atomic override) - the policies that contributed + // to the effective policy are the ones that overrode this policy + overridingPolicies[policyRuleKey] = append(overridingPolicies[policyRuleKey], effectivePolicy.SourcePolicies...) } - overridingPolicies[policyRuleKey] = append(overridingPolicies[policyRuleKey], overriddenBy) continue } // policy rule is in the effective policy, track the Gateway affected by the policy diff --git a/internal/controller/tokenratelimitpolicy_status_updater.go b/internal/controller/tokenratelimitpolicy_status_updater.go index e7aec7963..8fd9b5524 100644 --- a/internal/controller/tokenratelimitpolicy_status_updater.go +++ b/internal/controller/tokenratelimitpolicy_status_updater.go @@ -192,11 +192,14 @@ func (r *TokenRateLimitPolicyStatusUpdater) enforcedCondition(policy *kuadrantv1 effectivePolicyRules := effectivePolicy.Spec.Rules() for _, policyRuleKey := range policyRuleKeys { if effectivePolicyRule, ok := effectivePolicyRules[policyRuleKey]; !ok || (ok && effectivePolicyRule.GetSource() != policy.GetLocator()) { // policy rule has been overridden by another policy - var overriddenBy string if ok { - overriddenBy = effectivePolicyRule.GetSource() + // Rule exists in effective policy but from a different source (rule-level override) + overridingPolicies[policyRuleKey] = append(overridingPolicies[policyRuleKey], effectivePolicyRule.GetSource()) + } else { + // Rule doesn't exist at all (atomic override) - the policies that contributed + // to the effective policy are the ones that overrode this policy + overridingPolicies[policyRuleKey] = append(overridingPolicies[policyRuleKey], effectivePolicy.SourcePolicies...) } - overridingPolicies[policyRuleKey] = append(overridingPolicies[policyRuleKey], overriddenBy) continue } // policy rule is in the effective policy, track the Gateway affected by the policy diff --git a/internal/kuadrant/errors.go b/internal/kuadrant/errors.go index a27760a7f..fa79663a4 100644 --- a/internal/kuadrant/errors.go +++ b/internal/kuadrant/errors.go @@ -168,9 +168,6 @@ type ErrOverridden struct { } func (e ErrOverridden) Error() string { - if len(e.OverridingPolicies) == 0 { - return fmt.Sprintf("%s is overridden", e.Kind) - } return fmt.Sprintf("%s is overridden by %s", e.Kind, e.OverridingPolicies) } diff --git a/tests/bare_k8s/suite_test.go b/tests/bare_k8s/suite_test.go index 4861aa1e3..80373126a 100644 --- a/tests/bare_k8s/suite_test.go +++ b/tests/bare_k8s/suite_test.go @@ -22,6 +22,7 @@ import ( "encoding/json" "os" "testing" + "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -48,6 +49,9 @@ func testClient() client.Client { return k8sClient } func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) + SetDefaultEventuallyPollingInterval(500 * time.Millisecond) + SetDefaultEventuallyTimeout(2 * time.Minute) + RunSpecs(t, "Controller suite on bare k8s") } diff --git a/tests/common/authpolicy/suite_test.go b/tests/common/authpolicy/suite_test.go index c2eeaaedf..c2e9244d9 100644 --- a/tests/common/authpolicy/suite_test.go +++ b/tests/common/authpolicy/suite_test.go @@ -23,6 +23,7 @@ import ( "encoding/json" "os" "testing" + "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -51,6 +52,9 @@ func testClient() client.Client { return k8sClient } func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) + SetDefaultEventuallyPollingInterval(500 * time.Millisecond) + SetDefaultEventuallyTimeout(2 * time.Minute) + RunSpecs(t, "AuthPolicy Controller Suite") } diff --git a/tests/common/discoverability/suite_test.go b/tests/common/discoverability/suite_test.go index 723c3083c..5d3cb6306 100644 --- a/tests/common/discoverability/suite_test.go +++ b/tests/common/discoverability/suite_test.go @@ -23,6 +23,7 @@ import ( "encoding/json" "os" "testing" + "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -51,6 +52,9 @@ func testClient() client.Client { return k8sClient } func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) + SetDefaultEventuallyPollingInterval(500 * time.Millisecond) + SetDefaultEventuallyTimeout(2 * time.Minute) + RunSpecs(t, "Target Status Controller Suite") } diff --git a/tests/common/dnspolicy/suite_test.go b/tests/common/dnspolicy/suite_test.go index 60435891b..f7218e89b 100644 --- a/tests/common/dnspolicy/suite_test.go +++ b/tests/common/dnspolicy/suite_test.go @@ -22,6 +22,7 @@ import ( "encoding/json" "os" "testing" + "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -61,6 +62,9 @@ func testDynamicClient() *dynamic.DynamicClient { func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) + SetDefaultEventuallyPollingInterval(500 * time.Millisecond) + SetDefaultEventuallyTimeout(2 * time.Minute) + RunSpecs(t, "DNS Controller Suite") } diff --git a/tests/common/ratelimitpolicy/ratelimitpolicy_controller_test.go b/tests/common/ratelimitpolicy/ratelimitpolicy_controller_test.go index a3607a07c..fbb15de1c 100644 --- a/tests/common/ratelimitpolicy/ratelimitpolicy_controller_test.go +++ b/tests/common/ratelimitpolicy/ratelimitpolicy_controller_test.go @@ -13,6 +13,7 @@ import ( . "github.com/onsi/gomega" "github.com/samber/lo" appsv1 "k8s.io/api/apps/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/ptr" @@ -359,7 +360,9 @@ var _ = Describe("RateLimitPolicy controller", func() { // Check RLP status is available rlpKey := client.ObjectKey{Name: rlpName, Namespace: testNamespace} Eventually(assertPolicyIsAcceptedAndNotEnforced(ctx, rlpKey)).WithContext(ctx).Should(BeTrue()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), rlpKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes")).To(BeTrue()) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), rlpKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes") + }).WithContext(ctx).Should(BeTrue()) // check limits Eventually(func(g Gomega) { @@ -454,7 +457,9 @@ var _ = Describe("RateLimitPolicy controller", func() { Expect(k8sClient.Create(ctx, gwRLP)).To(Succeed()) gwRLPKey := client.ObjectKey{Name: gwRLP.Name, Namespace: testNamespace} Eventually(assertPolicyIsAcceptedAndNotEnforced(ctx, gwRLPKey)).WithContext(ctx).Should(BeTrue()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), gwRLPKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes")).To(BeTrue()) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), gwRLPKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes") + }).WithContext(ctx).Should(BeTrue()) }, testTimeOut) It("Implicit defaults - no underlying routes to enforce policy", func(ctx SpecContext) { @@ -468,7 +473,9 @@ var _ = Describe("RateLimitPolicy controller", func() { Expect(k8sClient.Create(ctx, gwRLP)).To(Succeed()) gwRLPKey := client.ObjectKey{Name: gwRLP.Name, Namespace: testNamespace} Eventually(assertPolicyIsAcceptedAndNotEnforced(ctx, gwRLPKey)).WithContext(ctx).Should(BeTrue()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), gwRLPKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes")).To(BeTrue()) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), gwRLPKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes") + }).WithContext(ctx).Should(BeTrue()) }, testTimeOut) }) @@ -514,7 +521,9 @@ var _ = Describe("RateLimitPolicy controller", func() { Expect(k8sClient.Create(ctx, routeRLP)).To(Succeed()) routeRLPKey := client.ObjectKeyFromObject(routeRLP) Eventually(assertPolicyIsAcceptedAndNotEnforced(ctx, routeRLPKey)).WithContext(ctx).Should(BeTrue()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), routeRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", gwRLPKey))) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), routeRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", gwRLPKey)) + }).WithContext(ctx).Should(BeTrue()) limitsNamespace := controllers.LimitsNamespaceFromRoute(httpRoute) @@ -555,7 +564,9 @@ var _ = Describe("RateLimitPolicy controller", func() { // Route RLP should no longer be enforced Eventually(tests.RLPIsEnforced(ctx, testClient(), routeRLPKey)).WithContext(ctx).Should(BeFalse()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), routeRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", gwRLPKey))) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), routeRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", gwRLPKey)) + }).WithContext(ctx).Should(BeTrue()) // Should contain override values Eventually(limitadorContainsLimit(ctx, limitadorv1alpha1.RateLimit{ @@ -582,7 +593,9 @@ var _ = Describe("RateLimitPolicy controller", func() { Expect(k8sClient.Create(ctx, gwRLP)).To(Succeed()) gwRLPKey := client.ObjectKeyFromObject(gwRLP) Eventually(assertPolicyIsAcceptedAndNotEnforced(ctx, gwRLPKey)).WithContext(ctx).Should(BeTrue()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), gwRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", routeRLPKey))) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), gwRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", routeRLPKey)) + }).WithContext(ctx).Should(BeTrue()) // Route RLP should still be enforced Eventually(tests.RLPIsEnforced(ctx, testClient(), routeRLPKey)).WithContext(ctx).Should(BeTrue()) @@ -609,7 +622,9 @@ var _ = Describe("RateLimitPolicy controller", func() { // GW RLP should now be enforced Eventually(tests.RLPIsEnforced(ctx, testClient(), routeRLPKey)).WithContext(ctx).Should(BeFalse()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), routeRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", gwRLPKey))) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), routeRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", gwRLPKey)) + }).WithContext(ctx).Should(BeTrue()) Eventually(tests.RLPIsEnforced(ctx, testClient(), gwRLPKey)).WithContext(ctx).Should(BeTrue()) // Should contain override values @@ -636,7 +651,9 @@ var _ = Describe("RateLimitPolicy controller", func() { // Route RLP should not be enforced Eventually(tests.RLPIsEnforced(ctx, testClient(), routeRLPKey)).WithContext(ctx).Should(BeFalse()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), routeRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", gwRLPKey))) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), routeRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", gwRLPKey)) + }).WithContext(ctx).Should(BeTrue()) limitsNamespace := controllers.LimitsNamespaceFromRoute(httpRoute) @@ -660,7 +677,9 @@ var _ = Describe("RateLimitPolicy controller", func() { // Route RLP now takes precedence Eventually(tests.RLPIsEnforced(ctx, testClient(), gwRLPKey)).WithContext(ctx).Should(BeFalse()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), gwRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", routeRLPKey))) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), gwRLPKey, kuadrant.PolicyReasonOverridden, fmt.Sprintf("RateLimitPolicy is overridden by [%s]", routeRLPKey)) + }).WithContext(ctx).Should(BeTrue()) Eventually(tests.RLPIsEnforced(ctx, testClient(), routeRLPKey)).WithContext(ctx).Should(BeTrue()) // Should contain Route RLP values @@ -676,13 +695,23 @@ var _ = Describe("RateLimitPolicy controller", func() { It("Gateway atomic override - no underlying routes to enforce policy", func(ctx SpecContext) { // Delete HTTPRoute - Expect(k8sClient.Delete(ctx, &gatewayapiv1.HTTPRoute{ObjectMeta: metav1.ObjectMeta{Name: routeName, Namespace: testNamespace}})).To(Succeed()) + Expect(k8sClient.Delete(ctx, httpRoute)).To(Succeed()) + + Eventually(func() bool { + route := &gatewayapiv1.HTTPRoute{} + err := k8sClient.Get(ctx, client.ObjectKeyFromObject(httpRoute), route) + // Either deleted OR has deletionTimestamp + return apierrors.IsNotFound(err) || + (err == nil && route.GetDeletionTimestamp() != nil) + }).WithContext(ctx).WithTimeout(5 * time.Second).Should(BeTrue()) // create GW RLP with overrides Expect(k8sClient.Create(ctx, gwRLP)).To(Succeed()) gwRLPKey := client.ObjectKey{Name: gwRLP.Name, Namespace: testNamespace} Eventually(assertPolicyIsAcceptedAndNotEnforced(ctx, gwRLPKey)).WithContext(ctx).Should(BeTrue()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), gwRLPKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes")).To(BeTrue()) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), gwRLPKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes") + }).WithContext(ctx).Should(BeTrue()) }, testTimeOut) }) diff --git a/tests/common/ratelimitpolicy/suite_test.go b/tests/common/ratelimitpolicy/suite_test.go index 60235b147..192a40661 100644 --- a/tests/common/ratelimitpolicy/suite_test.go +++ b/tests/common/ratelimitpolicy/suite_test.go @@ -23,6 +23,7 @@ import ( "encoding/json" "os" "testing" + "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -51,6 +52,9 @@ func testClient() client.Client { return k8sClient } func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) + SetDefaultEventuallyPollingInterval(500 * time.Millisecond) + SetDefaultEventuallyTimeout(2 * time.Minute) + RunSpecs(t, "RateLimitPolicy Controller Suite") } diff --git a/tests/common/tlspolicy/suite_test.go b/tests/common/tlspolicy/suite_test.go index e95e116ef..89d0240fe 100644 --- a/tests/common/tlspolicy/suite_test.go +++ b/tests/common/tlspolicy/suite_test.go @@ -22,6 +22,7 @@ import ( "encoding/json" "os" "testing" + "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -48,6 +49,9 @@ func testClient() client.Client { return k8sClient } func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) + SetDefaultEventuallyPollingInterval(500 * time.Millisecond) + SetDefaultEventuallyTimeout(2 * time.Minute) + RunSpecs(t, "TLS Policy Controller Suite") } diff --git a/tests/envoygateway/observability_reconciler_test.go b/tests/envoygateway/observability_reconciler_test.go index 039b7e4dd..cd1336859 100644 --- a/tests/envoygateway/observability_reconciler_test.go +++ b/tests/envoygateway/observability_reconciler_test.go @@ -98,11 +98,11 @@ var _ = Describe("Observabiltity monitors for envoy gateway", func() { Namespace: kuadrantNS, }, } - err := testClient().Get(ctx, client.ObjectKeyFromObject(kuadrantCR), kuadrantCR) - Expect(err).NotTo(HaveOccurred()) - kuadrantCR.Spec.Observability.Enable = true - err = testClient().Update(ctx, kuadrantCR) - Expect(err).NotTo(HaveOccurred()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, client.ObjectKeyFromObject(kuadrantCR), kuadrantCR)).To(Succeed()) + kuadrantCR.Spec.Observability.Enable = true + g.Expect(testClient().Update(ctx, kuadrantCR)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) // Verify all monitors are created Eventually(func(g Gomega) { diff --git a/tests/envoygateway/suite_test.go b/tests/envoygateway/suite_test.go index 321d6ffb6..4ae7948f1 100644 --- a/tests/envoygateway/suite_test.go +++ b/tests/envoygateway/suite_test.go @@ -7,6 +7,7 @@ import ( "encoding/json" "os" "testing" + "time" controllers "github.com/kuadrant/kuadrant-operator/internal/controller" "github.com/kuadrant/kuadrant-operator/internal/log" @@ -29,6 +30,9 @@ func testClient() client.Client { return k8sClient } func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) + SetDefaultEventuallyPollingInterval(500 * time.Millisecond) + SetDefaultEventuallyTimeout(2 * time.Minute) + RunSpecs(t, "Controller Suite on Envoy Gateway") } diff --git a/tests/gatewayapi/suite_test.go b/tests/gatewayapi/suite_test.go index 314b87f64..cc244f622 100644 --- a/tests/gatewayapi/suite_test.go +++ b/tests/gatewayapi/suite_test.go @@ -22,6 +22,7 @@ import ( "encoding/json" "os" "testing" + "time" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -48,6 +49,9 @@ func testClient() client.Client { return k8sClient } func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) + SetDefaultEventuallyPollingInterval(500 * time.Millisecond) + SetDefaultEventuallyTimeout(2 * time.Minute) + RunSpecs(t, "Controller suite on bare k8s with only GatewayAPI installed") } diff --git a/tests/istio/authorino_istio_integration_reconciler_test.go b/tests/istio/authorino_istio_integration_reconciler_test.go index 2bc48f8ac..23f3ae1ed 100644 --- a/tests/istio/authorino_istio_integration_reconciler_test.go +++ b/tests/istio/authorino_istio_integration_reconciler_test.go @@ -81,9 +81,11 @@ var _ = Describe("Authorino Istio integration reconciler", Serial, func() { BeforeEach(func(ctx SpecContext) { kuadrantObj := &kuadrantv1beta1.Kuadrant{} kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) Eventually(tests.AuthorinoIsReady(testClient(), client.ObjectKey{ Name: "authorino", @@ -121,9 +123,11 @@ var _ = Describe("Authorino Istio integration reconciler", Serial, func() { BeforeEach(func(ctx SpecContext) { kuadrantObj := &kuadrantv1beta1.Kuadrant{} kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) Eventually(tests.AuthorinoIsReady(testClient(), client.ObjectKey{ Name: "authorino", @@ -145,9 +149,11 @@ var _ = Describe("Authorino Istio integration reconciler", Serial, func() { BeforeEach(func(ctx SpecContext) { kuadrantObj := &kuadrantv1beta1.Kuadrant{} kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true, Authorino: ptr.To(false)} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true, Authorino: ptr.To(false)} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) Eventually(tests.AuthorinoIsReady(testClient(), client.ObjectKey{ Name: "authorino", diff --git a/tests/istio/extension_reconciler_test.go b/tests/istio/extension_reconciler_test.go index cc3330894..e876a0449 100644 --- a/tests/istio/extension_reconciler_test.go +++ b/tests/istio/extension_reconciler_test.go @@ -969,7 +969,9 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { // Check RLP status is available rlpKey := client.ObjectKey{Name: rlpName, Namespace: testNamespace} Eventually(assertPolicyIsAcceptedAndNotEnforced(ctx, rlpKey)).WithContext(ctx).Should(BeTrue()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), rlpKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes")) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), rlpKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes") + }).WithContext(ctx).Should(BeTrue()) // Check wasm plugin wasmPluginKey := client.ObjectKey{Name: wasm.ExtensionName(gateway.GetName()), Namespace: testNamespace} @@ -1053,7 +1055,9 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { // Check RLP status is available rlpKey := client.ObjectKey{Name: rlpName, Namespace: testNamespace} Eventually(assertPolicyIsAcceptedAndNotEnforced(ctx, rlpKey)).WithContext(ctx).Should(BeTrue()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), rlpKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes")) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), rlpKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes") + }).WithContext(ctx).Should(BeTrue()) // create Route A -> Gw A httpRoute := tests.BuildBasicHttpRoute(routeName, TestGatewayName, testNamespace, []string{"*.example.com"}) @@ -1185,7 +1189,7 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { } // not found return true - }) + }).WithContext(ctx).Should(BeTrue()) // Proceed with the update: // From Route A -> Gw A @@ -1215,7 +1219,7 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { } // not found return true - }) + }).WithContext(ctx).Should(BeTrue()) // Check wasm plugin for gateway B does not exist // There is not RLP targeting Gateway B or any route parented by Gateway B @@ -1414,7 +1418,7 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { } // not found return true - }) + }).WithContext(ctx).Should(BeTrue()) // Proceed with the update: // From Route A -> Gw A @@ -1444,7 +1448,7 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { } // not found return true - }) + }).WithContext(ctx).Should(BeTrue()) mGateway = &machinery.Gateway{Gateway: gwB} pathID = kuadrantv1.PathID([]machinery.Targetable{ diff --git a/tests/istio/istio_auth_cluster_reconciler_test.go b/tests/istio/istio_auth_cluster_reconciler_test.go index 6a4b7d18f..3d8393f2b 100644 --- a/tests/istio/istio_auth_cluster_reconciler_test.go +++ b/tests/istio/istio_auth_cluster_reconciler_test.go @@ -59,9 +59,11 @@ var _ = Describe("Authorino Cluster EnvoyFilter controller", Serial, func() { kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} Eventually(tests.KuadrantIsReady(testClient(), kuadrantKey)).WithContext(ctx).Should(Succeed()) kuadrantObj := &kuadrantv1beta1.Kuadrant{} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) }) It("EnvoyFilter only created if KAP is in the path to a route", func(ctx SpecContext) { @@ -95,7 +97,7 @@ var _ = Describe("Authorino Cluster EnvoyFilter controller", Serial, func() { policyKey := client.ObjectKey{Name: apName, Namespace: testNamespace} Eventually(tests.IsAuthPolicyAccepted(ctx, testClient(), authPolicy)).WithContext(ctx).Should(BeTrue()) Eventually(tests.IsAuthPolicyEnforced(ctx, testClient(), authPolicy)).WithContext(ctx).Should(BeFalse()) - Expect(tests.IsAuthPolicyEnforcedCondition(ctx, testClient(), policyKey, kuadrant.PolicyReasonUnknown, "AuthPolicy is not in the path to any existing routes")) + Eventually(tests.IsAuthPolicyEnforcedCondition(ctx, testClient(), policyKey, kuadrant.PolicyReasonUnknown, "AuthPolicy is not in the path to any existing routes")).WithContext(ctx).Should(BeTrue()) // Check envoy filter has not been created Eventually(func(g Gomega, ctx context.Context) { @@ -148,9 +150,11 @@ var _ = Describe("Authorino Cluster EnvoyFilter controller", Serial, func() { kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} Eventually(tests.KuadrantIsReady(testClient(), kuadrantKey)).WithContext(ctx).Should(Succeed()) kuadrantObj := &kuadrantv1beta1.Kuadrant{} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) }) It("envoy filter has transport configured with TLS", func(ctx SpecContext) { diff --git a/tests/istio/istio_peerauthentication_reconciler_test.go b/tests/istio/istio_peerauthentication_reconciler_test.go index cf1ad4d2e..64ec9e4b2 100644 --- a/tests/istio/istio_peerauthentication_reconciler_test.go +++ b/tests/istio/istio_peerauthentication_reconciler_test.go @@ -90,9 +90,11 @@ var _ = Describe("PeerAuthentication reconciler", Serial, func() { BeforeEach(func(ctx SpecContext) { kuadrantObj := &kuadrantv1beta1.Kuadrant{} kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) }) It("peerauthentication is created", func(ctx SpecContext) { @@ -131,9 +133,11 @@ var _ = Describe("PeerAuthentication reconciler", Serial, func() { BeforeEach(func(ctx SpecContext) { kuadrantObj := &kuadrantv1beta1.Kuadrant{} kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) }) It("peerauthentication does not exist", func(ctx SpecContext) { diff --git a/tests/istio/kuadrant_status_updater_reconciler_test.go b/tests/istio/kuadrant_status_updater_reconciler_test.go index 398ad17ad..e5e173a71 100644 --- a/tests/istio/kuadrant_status_updater_reconciler_test.go +++ b/tests/istio/kuadrant_status_updater_reconciler_test.go @@ -119,9 +119,11 @@ var _ = Describe("kuadrant status reconciler", Serial, func() { BeforeEach(func(ctx SpecContext) { kuadrantObj := &kuadrantv1beta1.Kuadrant{} kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) }) It("reconciles status mtls fields", func(ctx SpecContext) { @@ -165,9 +167,11 @@ var _ = Describe("kuadrant status reconciler", Serial, func() { BeforeEach(func(ctx SpecContext) { kuadrantObj := &kuadrantv1beta1.Kuadrant{} kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) }) It("reconciles status mtls fields", func(ctx SpecContext) { diff --git a/tests/istio/limitador_istio_integration_reconciler_test.go b/tests/istio/limitador_istio_integration_reconciler_test.go index 5aa0415f4..cbd94477e 100644 --- a/tests/istio/limitador_istio_integration_reconciler_test.go +++ b/tests/istio/limitador_istio_integration_reconciler_test.go @@ -134,10 +134,11 @@ var _ = Describe("Limitador Istio integration reconciler", Serial, func() { BeforeEach(func(ctx SpecContext) { kuadrantObj := &kuadrantv1beta1.Kuadrant{} kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) - + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) Eventually(tests.LimitadorIsReady(testClient(), client.ObjectKey{ Name: "limitador", Namespace: kuadrantInstallationNS, diff --git a/tests/istio/observability_reconciler_test.go b/tests/istio/observability_reconciler_test.go index 948cff998..267e4da9c 100644 --- a/tests/istio/observability_reconciler_test.go +++ b/tests/istio/observability_reconciler_test.go @@ -98,11 +98,12 @@ var _ = Describe("Observabiltity monitors for istio gateway", func() { Namespace: kuadrantNS, }, } - err := testClient().Get(ctx, client.ObjectKeyFromObject(kuadrantCR), kuadrantCR) - Expect(err).NotTo(HaveOccurred()) - kuadrantCR.Spec.Observability.Enable = true - err = testClient().Update(ctx, kuadrantCR) - Expect(err).NotTo(HaveOccurred()) + + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, client.ObjectKeyFromObject(kuadrantCR), kuadrantCR)).To(Succeed()) + kuadrantCR.Spec.Observability.Enable = true + g.Expect(testClient().Update(ctx, kuadrantCR)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) // Verify all monitors are created Eventually(func(g Gomega) { diff --git a/tests/istio/rate_limit_cluster_reconciler_test.go b/tests/istio/rate_limit_cluster_reconciler_test.go index 6cca3d010..fc5f4b4d0 100644 --- a/tests/istio/rate_limit_cluster_reconciler_test.go +++ b/tests/istio/rate_limit_cluster_reconciler_test.go @@ -59,9 +59,11 @@ var _ = Describe("Limitador Cluster EnvoyFilter controller", Serial, func() { kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} Eventually(tests.KuadrantIsReady(testClient(), kuadrantKey)).WithContext(ctx).Should(Succeed()) kuadrantObj := &kuadrantv1beta1.Kuadrant{} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: false} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) }) It("EnvoyFilter only created if RLP is in the path to a route", func(ctx SpecContext) { @@ -102,7 +104,9 @@ var _ = Describe("Limitador Cluster EnvoyFilter controller", Serial, func() { rlpKey := client.ObjectKey{Name: rlpName, Namespace: testNamespace} Eventually(tests.RLPIsAccepted(ctx, testClient(), rlpKey)).WithContext(ctx).Should(BeTrue()) Eventually(tests.RLPIsEnforced(ctx, testClient(), rlpKey)).WithContext(ctx).Should(BeFalse()) - Expect(tests.RLPEnforcedCondition(ctx, testClient(), rlpKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes")) + Eventually(func() bool { + return tests.RLPEnforcedCondition(ctx, testClient(), rlpKey, kuadrant.PolicyReasonUnknown, "RateLimitPolicy is not in the path to any existing routes") + }).WithContext(ctx).Should(BeTrue()) // Check envoy filter has not been created Eventually(func() bool { @@ -155,9 +159,11 @@ var _ = Describe("Limitador Cluster EnvoyFilter controller", Serial, func() { kuadrantKey := client.ObjectKey{Name: "kuadrant-sample", Namespace: kuadrantInstallationNS} Eventually(tests.KuadrantIsReady(testClient(), kuadrantKey)).WithContext(ctx).Should(Succeed()) kuadrantObj := &kuadrantv1beta1.Kuadrant{} - Eventually(testClient().Get).WithContext(ctx).WithArguments(kuadrantKey, kuadrantObj).Should(Succeed()) - kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true} - Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + Eventually(func(g Gomega) { + g.Expect(testClient().Get(ctx, kuadrantKey, kuadrantObj)).To(Succeed()) + kuadrantObj.Spec.MTLS = &kuadrantv1beta1.MTLS{Enable: true} + g.Expect(testClient().Update(ctx, kuadrantObj)).To(Succeed()) + }).WithContext(ctx).Should(Succeed()) }) It("envoy filter has transport configured with TLS", func(ctx SpecContext) { diff --git a/tests/istio/suite_test.go b/tests/istio/suite_test.go index 6658c0648..16a2f0c45 100644 --- a/tests/istio/suite_test.go +++ b/tests/istio/suite_test.go @@ -23,6 +23,7 @@ import ( "encoding/json" "os" "testing" + "time" controllers "github.com/kuadrant/kuadrant-operator/internal/controller" "github.com/kuadrant/kuadrant-operator/internal/log" @@ -50,6 +51,9 @@ func testClient() client.Client { return k8sClient } func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) + SetDefaultEventuallyPollingInterval(500 * time.Millisecond) + SetDefaultEventuallyTimeout(2 * time.Minute) + RunSpecs(t, "Controller Suite on Istio") }