Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Commit

Permalink
Upgrade to eventing v1 apis and eventing 0.22 (#2199)
Browse files Browse the repository at this point in the history
* Replace usage of eventing v1beta1 APIs with v1

The v1beta1 versions of Broker and Trigger have been removed from upstream. The
v1 version has an identical schema, so replacing is just import juggling.

* use eventing duck v1 in broker

* stop using eventing v1beta1 apis in channel code

* fix typo

* fix typo

* update codegen

* Remove usage of eventing duck v1alpha1

* Update deps

* update codegen

* fix some cloudevents client breakages

* Use v1 types in transformation test

* Use v1 helpers in tests and elsewhere

* Replace tracing helpers removed from cloudevents sdk

StartChildSpan and friends are now in the knative-gcp tracing package.

* Use correct broker class helper

* Use correct trigger creation helper

* Use correct e2e test helpers

* More e2e helper fixes

* change broker GVK for tests to v1

* correct broker and trigger api version in conformance tests

* Remove usage of --strict in ko commands

--strict was removed from ko and strict mode is now the default.

* revert --strict change to vendored file

* upgrade deps to get --strict change

* update codegen

* Upgrade to eventing 0.22 apis

* update codegen

* back to the old naming scheme

* back to the old naming scheme 2

* Use correct e2e test helpers

* BrokerOpts still uses v1beta1 in 0.22

* Fix a few bits that still use broker v1beta1

* add trigger v1 dependency annotation option

* use v1 broker in tests

* use correct broker typemeta

* *really* use eventing v1

* hack to fix eventing 0.22 subscriber v1/v1beta1 bug; use trigger v1

* **really** use v1 trigger

* fork broker event transformation test helper to use correct broker version

* fork broker channel flow helper to use correct broker type

* use v1 subscription in conformance test

* use serving 0.22.0 and eventing 0.22.1 in tests

* link to tracking issues for TODOs

Co-authored-by: Tommy Reddad <reddad@google.com>
  • Loading branch information
grantr and tommyreddad authored May 4, 2021
1 parent 930cae6 commit 45ef817
Show file tree
Hide file tree
Showing 767 changed files with 32,611 additions and 14,752 deletions.
6 changes: 3 additions & 3 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"log"

brokerv1beta1 "github.com/google/knative-gcp/pkg/apis/broker/v1beta1"
brokerv1 "github.com/google/knative-gcp/pkg/apis/broker/v1"
"github.com/google/knative-gcp/pkg/apis/configs/brokerdelivery"
"github.com/google/knative-gcp/pkg/apis/configs/dataresidency"
"github.com/google/knative-gcp/pkg/apis/configs/gcpauth"
Expand Down Expand Up @@ -52,8 +52,8 @@ import (

var types = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
// For group eventing.knative.dev.
brokerv1beta1.SchemeGroupVersion.WithKind("Broker"): &brokerv1beta1.Broker{},
brokerv1beta1.SchemeGroupVersion.WithKind("Trigger"): &brokerv1beta1.Trigger{},
brokerv1.SchemeGroupVersion.WithKind("Broker"): &brokerv1.Broker{},
brokerv1.SchemeGroupVersion.WithKind("Trigger"): &brokerv1.Trigger{},

// For group messaging.cloud.google.com.
messagingv1beta1.SchemeGroupVersion.WithKind("Channel"): &messagingv1beta1.Channel{},
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/gcpbroker/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: eventing.knative.dev/v1beta1
apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
name: test-broker
namespace: broker-example
annotations:
"eventing.knative.dev/broker.class": "googlecloud"
"eventing.knative.dev/broker.class": "googlecloud"
18 changes: 8 additions & 10 deletions docs/examples/gcpbroker/triggers.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: eventing.knative.dev/v1beta1
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: hello-display
Expand All @@ -25,13 +24,12 @@ spec:
type: greeting
subscriber:
ref:
apiVersion: v1
kind: Service
name: hello-display
apiVersion: v1
kind: Service
name: hello-display

---

apiVersion: eventing.knative.dev/v1beta1
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: goodbye-display
Expand All @@ -43,6 +41,6 @@ spec:
source: sendoff
subscriber:
ref:
apiVersion: v1
kind: Service
name: goodbye-display
apiVersion: v1
kind: Service
name: goodbye-display
2 changes: 1 addition & 1 deletion docs/examples/metrics/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: eventing.knative.dev/v1beta1
apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
name: test-broker
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/metrics/trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: eventing.knative.dev/v1beta1
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: hello-display
Expand Down
2 changes: 1 addition & 1 deletion docs/install/install-gcp-broker.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ kubectl create namespace ${NAMESPACE}

```shell
kubectl apply -f - << END
apiVersion: eventing.knative.dev/v1beta1
apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
name: ${BROKER}
Expand Down
29 changes: 18 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,41 @@ require (
cloud.google.com/go/logging v1.0.1-0.20200331222814-69e77e66e597
cloud.google.com/go/pubsub v1.8.0
cloud.google.com/go/storage v1.10.0
contrib.go.opencensus.io/exporter/prometheus v0.3.0 // indirect
github.com/cloudevents/sdk-go/observability/opencensus/v2 v2.4.1
github.com/cloudevents/sdk-go/protocol/pubsub/v2 v2.2.1-0.20200806165906-9ae0708e27fa
github.com/cloudevents/sdk-go/v2 v2.3.1
github.com/cloudevents/sdk-go/v2 v2.4.1
github.com/fsnotify/fsnotify v1.4.9
github.com/golang/protobuf v1.4.3
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.5
github.com/google/uuid v1.2.0
github.com/google/wire v0.4.0
github.com/googleapis/gax-go/v2 v2.0.5
github.com/kelseyhightower/envconfig v1.4.0
github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.10.0 // indirect
github.com/prometheus/common v0.20.0 // indirect
github.com/rickb777/date v1.13.0
go.opencensus.io v0.23.0
go.uber.org/multierr v1.6.0
go.uber.org/zap v1.16.0
golang.org/x/net v0.0.0-20210119194325-5f4716e94777
golang.org/x/oauth2 v0.0.0-20210126194326-f9ce19ea3013
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc // indirect
golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d
golang.org/x/oauth2 v0.0.0-20210413134643-5e61552d6c78
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
google.golang.org/api v0.36.0
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d
google.golang.org/grpc v1.36.0
google.golang.org/protobuf v1.25.0
google.golang.org/genproto v0.0.0-20210416161957-9910b6c460de
google.golang.org/grpc v1.37.0
google.golang.org/protobuf v1.26.0
k8s.io/api v0.19.7
k8s.io/apimachinery v0.19.7
k8s.io/client-go v0.19.7
knative.dev/eventing v0.21.3
knative.dev/eventing v0.22.1
knative.dev/hack v0.0.0-20210325223819-b6ab329907d3
knative.dev/pkg v0.0.0-20210329065222-9d92ea16c0d3
knative.dev/serving v0.21.1-0.20210329141824-69610eb27a1f
knative.dev/pkg v0.0.0-20210331065221-952fdd90dbb0
knative.dev/serving v0.22.0
sigs.k8s.io/yaml v1.2.0
)

Expand Down
Loading

0 comments on commit 45ef817

Please sign in to comment.