Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Knative history extension #4366

Merged
merged 2 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 0 additions & 71 deletions pkg/channel/history_transformer.go

This file was deleted.

155 changes: 0 additions & 155 deletions pkg/channel/history_transformer_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/channel/message_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (r *MessageReceiver) ServeHTTP(response nethttp.ResponseWriter, request *ne
r.reporter.ReportEventCount(&args, nethttp.StatusBadRequest)
return
}
err = r.receiverFunc(request.Context(), channel, message, []binding.Transformer{AddHistory(host)}, utils.PassThroughHeaders(request.Header))
err = r.receiverFunc(request.Context(), channel, message, []binding.Transformer{}, utils.PassThroughHeaders(request.Header))
if err != nil {
if _, ok := err.(*UnknownChannelError); ok {
response.WriteHeader(nethttp.StatusNotFound)
Expand Down
10 changes: 0 additions & 10 deletions pkg/channel/message_receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,6 @@ func TestMessageReceiver_ServeHTTP(t *testing.T) {
return fmt.Errorf("test receiver func -- bad headers (-want, +got): %s", diff)
}

// Check history
if h, ok := e.Extensions()[EventHistory]; !ok {
return fmt.Errorf("test receiver func -- history not added")
} else {
expectedHistory := "test-name.test-namespace.svc." + network.GetClusterDomainName()
if h != expectedHistory {
return fmt.Errorf("test receiver func -- bad history: %v", h)
}
}

return nil
},
expected: nethttp.StatusAccepted,
Expand Down
17 changes: 1 addition & 16 deletions test/conformance/helpers/channel_data_plane_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
. "github.com/cloudevents/sdk-go/v2/test"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

eventingchannel "knative.dev/eventing/pkg/channel"
testlib "knative.dev/eventing/test/lib"
"knative.dev/eventing/test/lib/recordevents"
"knative.dev/eventing/test/lib/resources"
Expand Down Expand Up @@ -113,21 +112,7 @@ func channelDataPlaneSuccessTest(ctx context.Context, t *testing.T, channel meta
} else {
matchers = append(matchers, HasNoData())
}
// The extension matcher needs to match an eventual extension containing knativehistory extension
// (which is not mandatory by the spec)
extensions := event.Extensions()
extKeys := make([]string, 0, len(extensions))
for k := range extensions {
extKeys = append(extKeys, k)
}
extKeys = append(extKeys, eventingchannel.EventHistory)
matchers = append(matchers, AnyOf(
HasExactlyExtensions(event.Extensions()),
AllOf(
ContainsExactlyExtensions(extKeys...),
HasExtensions(event.Extensions()),
),
))
matchers = append(matchers, HasExactlyExtensions(event.Extensions()))

eventTracker.AssertExact(
1,
Expand Down