From d15bd5ac2c6f88180a83ad85f2a40561e6fd2e5a Mon Sep 17 00:00:00 2001 From: Marcin Skalski Date: Thu, 30 Jan 2025 08:44:19 +0100 Subject: [PATCH] feat(kuma-cp): fix e2e tests Signed-off-by: Marcin Skalski --- pkg/plugins/policies/meshtimeout/api/v1alpha1/validator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/plugins/policies/meshtimeout/api/v1alpha1/validator.go b/pkg/plugins/policies/meshtimeout/api/v1alpha1/validator.go index 9313127c3e29..8e6b57124e3a 100644 --- a/pkg/plugins/policies/meshtimeout/api/v1alpha1/validator.go +++ b/pkg/plugins/policies/meshtimeout/api/v1alpha1/validator.go @@ -12,7 +12,7 @@ import ( func (r *MeshTimeoutResource) validate() error { var verr validators.ValidationError path := validators.RootedAt("spec") - verr.AddErrorAt(path.Field("targetRef"), r.validateTop(r.Spec.TargetRef, len(r.Spec.From) > 0)) + verr.AddErrorAt(path.Field("targetRef"), r.validateTop(r.Spec.TargetRef, len(r.Spec.From) > 0 || len(r.Spec.Rules) > 0)) if len(r.Spec.Rules) > 0 && (len(r.Spec.To) > 0 || len(r.Spec.From) > 0) { verr.AddViolationAt(path, "fields 'to' and 'from' must be empty when 'rules' is defined") }