diff --git a/go.mod b/go.mod index d402305b6..58f4ee0e2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,7 @@ module github.com/fluxcd/notification-controller -go 1.22.5 +go 1.23 + toolchain go1.23.1 replace github.com/fluxcd/notification-controller/api => ./api diff --git a/internal/server/receiver_handler_test.go b/internal/server/receiver_handler_test.go index e460f72f1..2125ee8c2 100644 --- a/internal/server/receiver_handler_test.go +++ b/internal/server/receiver_handler_test.go @@ -145,7 +145,7 @@ func Test_handlePayload(t *testing.T) { "id": "5555", "source": "github", "timestamp": "2023-12-07T14:51:29.908479495Z", - "type": "dev.cdevents.change.merged.0.1.2", + "type": "dev.cdevents.change.merged.0.2.0", }, "subject": map[string]string{ "type": "change", @@ -191,7 +191,7 @@ func Test_handlePayload(t *testing.T) { "id": "5555", "source": "github", "timestamp": "2023-12-07T14:51:29.908479495Z", - "type": "dev.cdevents.change.merged.0.1.2", + "type": "dev.cdevents.change.merged.0.2.0", }, "subject": map[string]string{ "type": "change", @@ -236,7 +236,7 @@ func Test_handlePayload(t *testing.T) { "id": "5555", "source": "github", "timestamp": "2023-12-07T14:51:29.908479495Z", - "type": "dev.cdevents.change.merged.0.1.2", + "type": "dev.cdevents.change.merged.0.2.0", }, "subject": map[string]string{ "type": "change", diff --git a/internal/server/receiver_handlers.go b/internal/server/receiver_handlers.go index 558c6082d..5c3dfd75b 100644 --- a/internal/server/receiver_handlers.go +++ b/internal/server/receiver_handlers.go @@ -32,6 +32,7 @@ import ( "time" cdevents "github.com/cdevents/sdk-go/pkg/api" + cdevents04 "github.com/cdevents/sdk-go/pkg/api/v04" "github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/runtime/conditions" "github.com/go-logr/logr" @@ -205,7 +206,7 @@ func (s *ReceiverServer) validate(ctx context.Context, receiver apiv1.Receiver, return fmt.Errorf("unable to read CDEvent request body: %s", err) } - cdevent, err := cdevents.NewFromJsonBytes(b) + cdevent, err := cdevents04.NewFromJsonBytes(b) if err != nil { return fmt.Errorf("unable to validate CDEvent event: %s", err) }