diff --git a/pkg/apis/messaging/v1/subscription_validation.go b/pkg/apis/messaging/v1/subscription_validation.go index 7b1b82a06ba..a29363caf03 100644 --- a/pkg/apis/messaging/v1/subscription_validation.go +++ b/pkg/apis/messaging/v1/subscription_validation.go @@ -99,7 +99,7 @@ func (s *Subscription) CheckImmutableFields(ctx context.Context, original *Subsc } // Only Subscriber and Reply are mutable. - ignoreArguments := cmpopts.IgnoreFields(SubscriptionSpec{}, "Subscriber", "Reply") + ignoreArguments := cmpopts.IgnoreFields(SubscriptionSpec{}, "Subscriber", "Reply", "Delivery") if diff, err := kmp.ShortDiff(original.Spec, s.Spec, ignoreArguments); err != nil { return &apis.FieldError{ Message: "Failed to diff Subscription", diff --git a/pkg/apis/messaging/v1/subscription_validation_test.go b/pkg/apis/messaging/v1/subscription_validation_test.go index 8312c1aaadc..89815024895 100644 --- a/pkg/apis/messaging/v1/subscription_validation_test.go +++ b/pkg/apis/messaging/v1/subscription_validation_test.go @@ -20,6 +20,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" + "k8s.io/utils/pointer" "knative.dev/pkg/apis" duckv1 "knative.dev/pkg/apis/duck/v1" @@ -528,6 +529,23 @@ func TestSubscriptionImmutable(t *testing.T) { }, }, want: nil, + }, { + name: "valid, change delivery spec", + c: &Subscription{ + Spec: SubscriptionSpec{ + Channel: getValidChannelRef(), + Subscriber: getValidDestination(), + Delivery: &eventingduckv1.DeliverySpec{Retry: pointer.Int32(2)}, + }, + }, + og: &Subscription{ + Spec: SubscriptionSpec{ + Channel: getValidChannelRef(), + Subscriber: getValidDestination(), + Delivery: &eventingduckv1.DeliverySpec{Retry: pointer.Int32(3)}, + }, + }, + want: nil, }, { name: "Channel changed", c: &Subscription{