Skip to content

Commit

Permalink
Use preview4 of CloudEvents SDK, adds support for go mod for v2 and r…
Browse files Browse the repository at this point in the history
…enames legacy to v1 (#2772)
  • Loading branch information
n3wscott authored Mar 18, 2020
1 parent 230deb8 commit 0c37ce8
Show file tree
Hide file tree
Showing 245 changed files with 351 additions and 352 deletions.
94 changes: 47 additions & 47 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ required = [

[[constraint]]
name = "github.com/cloudevents/sdk-go"
version = "v2.0.0-preview3"
version = "v2.0.0-preview4"

# needed because pkg upgraded
[[override]]
Expand Down
2 changes: 1 addition & 1 deletion cmd/broker/ingress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
// Uncomment the following line to load the gcp plugin (only required to authenticate against GKE clusters).
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"github.com/google/uuid"
"github.com/kelseyhightower/envconfig"
"go.opencensus.io/stats/view"
Expand Down
1 change: 0 additions & 1 deletion cmd/ping/adapter/kodata/vendor

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/pong/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"flag"
"log"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"github.com/google/uuid"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/sendevent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"log"
"os"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"

"knative.dev/eventing/pkg/utils"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/adapter/apiserver/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"
"time"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"go.uber.org/zap"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/adapter/apiserver/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"

sourcesv1alpha1 "knative.dev/eventing/pkg/apis/sources/v1alpha1"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/adapter/apiserver/events/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/google/go-cmp/cmp/cmpopts"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"github.com/google/go-cmp/cmp"

"knative.dev/eventing/pkg/adapter/apiserver/events"
Expand Down
2 changes: 1 addition & 1 deletion pkg/adapter/apiserver/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"reflect"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"go.uber.org/zap"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand Down
2 changes: 1 addition & 1 deletion pkg/adapter/apiserver/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package apiserver
import (
"context"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"go.uber.org/zap"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/tools/cache"
Expand Down
2 changes: 1 addition & 1 deletion pkg/adapter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// Uncomment the following line to load the gcp plugin
// (only required to authenticate against GKE clusters).
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"github.com/kelseyhightower/envconfig"
"go.opencensus.io/stats/view"
"go.uber.org/zap"
Expand Down
2 changes: 1 addition & 1 deletion pkg/adapter/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
// Uncomment the following line to load the gcp plugin
// (only required to authenticate against GKE clusters).
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"go.opencensus.io/stats/view"
"knative.dev/pkg/metrics"
"knative.dev/pkg/source"
Expand Down
2 changes: 1 addition & 1 deletion pkg/adapter/ping/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"encoding/json"
"fmt"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"github.com/robfig/cron"
"go.uber.org/zap"
"knative.dev/pkg/logging"
Expand Down
2 changes: 1 addition & 1 deletion pkg/broker/filter/filter_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"sync/atomic"
"time"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"go.uber.org/zap"
pkgtracing "knative.dev/pkg/tracing"

Expand Down
6 changes: 3 additions & 3 deletions pkg/broker/filter/filter_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (

"k8s.io/apimachinery/pkg/labels"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cepkg "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
cehttp "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport/http"
cloudevents "github.com/cloudevents/sdk-go/v1"
cepkg "github.com/cloudevents/sdk-go/v1/cloudevents"
cehttp "github.com/cloudevents/sdk-go/v1/cloudevents/transport/http"
"github.com/google/go-cmp/cmp"
"go.uber.org/zap"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
4 changes: 2 additions & 2 deletions pkg/broker/ingress/ingress_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"net/url"
"time"

cloudevents "github.com/cloudevents/sdk-go/legacy"
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/client"
cloudevents "github.com/cloudevents/sdk-go/v1"
"github.com/cloudevents/sdk-go/v1/cloudevents/client"
"go.uber.org/zap"

"knative.dev/eventing/pkg/broker"
Expand Down
4 changes: 2 additions & 2 deletions pkg/broker/ingress/ingress_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"testing"
"time"

cloudevents "github.com/cloudevents/sdk-go/legacy"
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport/http"
cloudevents "github.com/cloudevents/sdk-go/v1"
"github.com/cloudevents/sdk-go/v1/cloudevents/transport/http"
"go.uber.org/zap"

"knative.dev/eventing/pkg/broker"
Expand Down
6 changes: 3 additions & 3 deletions pkg/broker/ttl.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package broker
import (
"context"

cloudevents "github.com/cloudevents/sdk-go/legacy"
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/client"
cetypes "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
cloudevents "github.com/cloudevents/sdk-go/v1"
"github.com/cloudevents/sdk-go/v1/cloudevents/client"
cetypes "github.com/cloudevents/sdk-go/v1/cloudevents/types"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/broker/ttl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"testing"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"go.uber.org/zap"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/channel/event_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"net/http"
"net/url"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cehttp "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport/http"
cloudevents "github.com/cloudevents/sdk-go/v1"
cehttp "github.com/cloudevents/sdk-go/v1/cloudevents/transport/http"
"go.opencensus.io/plugin/ochttp/propagation/b3"
"go.uber.org/zap"
"k8s.io/apimachinery/pkg/util/sets"
Expand Down
4 changes: 2 additions & 2 deletions pkg/channel/event_dispatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"strings"
"testing"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cehttp "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport/http"
cloudevents "github.com/cloudevents/sdk-go/v1"
cehttp "github.com/cloudevents/sdk-go/v1/cloudevents/transport/http"
"github.com/google/go-cmp/cmp"
"go.uber.org/zap"
"k8s.io/apimachinery/pkg/util/sets"
Expand Down
2 changes: 1 addition & 1 deletion pkg/channel/event_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"strings"
"time"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"go.uber.org/zap"

"knative.dev/eventing/pkg/kncloudevents"
Expand Down
4 changes: 2 additions & 2 deletions pkg/channel/event_receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"net/http"
"testing"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cehttp "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport/http"
cloudevents "github.com/cloudevents/sdk-go/v1"
cehttp "github.com/cloudevents/sdk-go/v1/cloudevents/transport/http"
"github.com/google/go-cmp/cmp"
_ "knative.dev/pkg/system/testing"

Expand Down
2 changes: 1 addition & 1 deletion pkg/channel/fanout/fanout_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"errors"
"time"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cloudevents "github.com/cloudevents/sdk-go/v1"
"go.opencensus.io/trace"
"go.uber.org/zap"

Expand Down
4 changes: 2 additions & 2 deletions pkg/channel/fanout/fanout_handler_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
nethttp "net/http"
"time"

"github.com/cloudevents/sdk-go/pkg/binding"
"github.com/cloudevents/sdk-go/pkg/binding/buffering"
"github.com/cloudevents/sdk-go/v2/binding"
"github.com/cloudevents/sdk-go/v2/binding/buffering"
"go.opencensus.io/trace"
"go.uber.org/zap"

Expand Down
6 changes: 3 additions & 3 deletions pkg/channel/fanout/fanout_handler_binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"testing"
"time"

cloudevents "github.com/cloudevents/sdk-go"
"github.com/cloudevents/sdk-go/pkg/binding"
bindingshttp "github.com/cloudevents/sdk-go/pkg/protocol/http"
cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/cloudevents/sdk-go/v2/binding"
bindingshttp "github.com/cloudevents/sdk-go/v2/protocol/http"
"go.uber.org/zap"
"knative.dev/pkg/apis"

Expand Down
8 changes: 4 additions & 4 deletions pkg/channel/fanout/fanout_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"testing"
"time"

cloudevents "github.com/cloudevents/sdk-go/legacy"
cehttp "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport/http"
cloudevents "github.com/cloudevents/sdk-go/v1"
cehttp "github.com/cloudevents/sdk-go/v1/cloudevents/transport/http"
"go.uber.org/atomic"
"go.uber.org/zap"
"knative.dev/pkg/apis"
Expand Down Expand Up @@ -142,7 +142,7 @@ func TestFanoutHandler_ServeHTTP(t *testing.T) {
expectedStatus: http.StatusAccepted,
},
"one sub succeeds, one sub fails": {
skip: "RACE condition due to bug in cloudevents-sdk. Unskip it once the issue https://github.com/cloudevents/sdk-go/legacy/issues/193 is fixed",
skip: "RACE condition due to bug in cloudevents-sdk. Unskip it once the issue https://github.com/cloudevents/sdk-go/v1/issues/193 is fixed",
subs: []eventingduck.SubscriberSpec{
{
SubscriberURI: replaceSubscriber,
Expand Down Expand Up @@ -180,7 +180,7 @@ func TestFanoutHandler_ServeHTTP(t *testing.T) {
expectedStatus: http.StatusAccepted,
},
"all subs succeed with async handler": {
skip: "RACE condition due to bug in cloudevents-sdk. Unskip it once the issue https://github.com/cloudevents/sdk-go/legacy/issues/193 is fixed",
skip: "RACE condition due to bug in cloudevents-sdk. Unskip it once the issue https://github.com/cloudevents/sdk-go/v1/issues/193 is fixed",
subs: []eventingduck.SubscriberSpec{
{
SubscriberURI: replaceSubscriber,
Expand Down
Loading

0 comments on commit 0c37ce8

Please sign in to comment.