From d05fc30568d6c8f2d3ca0c4e38721bd88453756f Mon Sep 17 00:00:00 2001 From: Ville Aikas Date: Fri, 5 Feb 2021 17:10:25 +0200 Subject: [PATCH] ut are actually kind of cool... fix the brokenness --- pkg/apis/eventing/v1beta1/trigger_validation.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/apis/eventing/v1beta1/trigger_validation.go b/pkg/apis/eventing/v1beta1/trigger_validation.go index b29e87014fc..c2a9f4a381e 100644 --- a/pkg/apis/eventing/v1beta1/trigger_validation.go +++ b/pkg/apis/eventing/v1beta1/trigger_validation.go @@ -38,6 +38,10 @@ func (t *Trigger) Validate(ctx context.Context) *apis.FieldError { errs := t.Spec.Validate(ctx).ViaField("spec") errs = t.validateAnnotation(errs, DependencyAnnotation, t.validateDependencyAnnotation) errs = t.validateAnnotation(errs, InjectionAnnotation, t.validateInjectionAnnotation) + if apis.IsInUpdate(ctx) { + original := apis.GetBaseline(ctx).(*Trigger) + errs = errs.Also(t.CheckImmutableFields(ctx, original)) + } return errs }