Skip to content

Commit

Permalink
feat(knative): upgrade Knative to 0.23 #2343
Browse files Browse the repository at this point in the history
Upgrading to Knative Eventing 0.23 drops support for the following API
versions:
* messaging.knative.dev/v1beta1
* sources.knative.dev/v1alpha1
* sources.knative.dev/v1alpha2
  • Loading branch information
tadayosi authored and astefanutti committed Jun 22, 2021
1 parent 8787ee2 commit ef93dae
Show file tree
Hide file tree
Showing 23 changed files with 145 additions and 70 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/knative.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ jobs:
- name: Install Knative
run: |
# Prerequisites
sudo pip install yq
sudo wget https://github.com/mikefarah/yq/releases/download/v4.9.6/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq
export SERVING_VERSION=v0.23.1
export EVENTING_VERSION=v0.17.9
export EVENTING_VERSION=v0.23.2
export KOURIER_VERSION=v0.23.0
export SOURCES_VERSION=v0.17.8
export SOURCES_VERSION=v0.23.0
# Serving
kubectl apply --filename https://github.com/knative/serving/releases/download/$SERVING_VERSION/serving-crds.yaml
curl -L -s https://github.com/knative/serving/releases/download/$SERVING_VERSION/serving-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
curl -L -s https://github.com/knative/serving/releases/download/$SERVING_VERSION/serving-core.yaml | head -n -1 | yq e 'del(.spec.template.spec.containers[].resources)' - | kubectl apply -f -
# Kourier
kubectl apply --filename https://github.com/knative/net-kourier/releases/download/$KOURIER_VERSION/kourier.yaml
Expand All @@ -112,19 +112,19 @@ jobs:
# Eventing
kubectl apply --filename https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-crds.yaml
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-core.yaml | head -n -1 | yq e 'del(.spec.template.spec.containers[].resources)' - | kubectl apply -f -
# Eventing channels
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/in-memory-channel.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/in-memory-channel.yaml | head -n -1 | yq e 'del(.spec.template.spec.containers[].resources)' - | kubectl apply -f -
# Eventing broker
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/mt-channel-broker.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/mt-channel-broker.yaml | head -n -1 | yq e 'del(.spec.template.spec.containers[].resources)' - | kubectl apply -f -
# Eventing sugar controller for injection
kubectl apply -f https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-sugar-controller.yaml
# Camel Sources
kubectl apply --filename https://github.com/knative/eventing-contrib/releases/download/$SOURCES_VERSION/camel.yaml
kubectl apply --filename https://github.com/knative-sandbox/eventing-camel/releases/download/$SOURCES_VERSION/camel.yaml
# Wait for installation completed
echo "Waiting for all pods to be ready in kourier-system"
Expand Down Expand Up @@ -216,16 +216,16 @@ jobs:
- name: Install Knative
run: |
# Prerequisites
sudo pip install yq
sudo wget https://github.com/mikefarah/yq/releases/download/v4.9.6/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq
export SERVING_VERSION=v0.23.1
export EVENTING_VERSION=v0.17.9
export EVENTING_VERSION=v0.23.2
export KOURIER_VERSION=v0.23.0
export SOURCES_VERSION=v0.17.8
export SOURCES_VERSION=v0.23.0
# Serving
kubectl apply --filename https://github.com/knative/serving/releases/download/$SERVING_VERSION/serving-crds.yaml
curl -L -s https://github.com/knative/serving/releases/download/$SERVING_VERSION/serving-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
curl -L -s https://github.com/knative/serving/releases/download/$SERVING_VERSION/serving-core.yaml | head -n -1 | yq e 'del(.spec.template.spec.containers[].resources)' - | kubectl apply -f -
# Kourier
kubectl apply --filename https://github.com/knative/net-kourier/releases/download/$KOURIER_VERSION/kourier.yaml
Expand All @@ -236,19 +236,19 @@ jobs:
# Eventing
kubectl apply --filename https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-crds.yaml
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-core.yaml | head -n -1 | yq e 'del(.spec.template.spec.containers[].resources)' - | kubectl apply -f -
# Eventing channels
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/in-memory-channel.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/in-memory-channel.yaml | head -n -1 | yq e 'del(.spec.template.spec.containers[].resources)' - | kubectl apply -f -
# Eventing broker
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/mt-channel-broker.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | kubectl apply -f -
curl -L -s https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/mt-channel-broker.yaml | head -n -1 | yq e 'del(.spec.template.spec.containers[].resources)' - | kubectl apply -f -
# Eventing sugar controller for injection
kubectl apply -f https://github.com/knative/eventing/releases/download/$EVENTING_VERSION/eventing-sugar-controller.yaml
# Camel Sources
kubectl apply --filename https://github.com/knative/eventing-contrib/releases/download/$SOURCES_VERSION/camel.yaml
kubectl apply --filename https://github.com/knative-sandbox/eventing-camel/releases/download/$SOURCES_VERSION/camel.yaml
# Wait for installation completed
echo "Waiting for all pods to be ready in kourier-system"
Expand Down
2 changes: 1 addition & 1 deletion config/samples/bases/camel_v1_kameletbinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ spec:
message: Hello world
sink:
ref:
apiVersion: messaging.knative.dev/v1beta1
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
name: example
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ metadata:
"spec": {
"sink": {
"ref": {
"apiVersion": "messaging.knative.dev/v1beta1",
"apiVersion": "messaging.knative.dev/v1",
"kind": "InMemoryChannel",
"name": "example"
}
Expand Down
4 changes: 2 additions & 2 deletions e2e/knative/kamelet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

v1 "k8s.io/api/core/v1"

messaging "knative.dev/eventing/pkg/apis/messaging/v1beta1"
messaging "knative.dev/eventing/pkg/apis/messaging/v1"

. "github.com/apache/camel-k/e2e/support"
camelv1 "github.com/apache/camel-k/pkg/apis/camel/v1"
Expand All @@ -39,7 +39,7 @@ func TestKameletChange(t *testing.T) {
WithNewTestNamespace(t, func(ns string) {
Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
Expect(CreateTimerKamelet(ns, "timer-source")()).To(Succeed())
Expect(CreateKnativeChannelv1Beta1(ns, "messages")()).To(Succeed())
Expect(CreateKnativeChannel(ns, "messages")()).To(Succeed())
Expect(Kamel("run", "-n", ns, "files/display.groovy", "-w").Execute()).To(Succeed())
ref := v1.ObjectReference{
Kind: "InMemoryChannel",
Expand Down
8 changes: 4 additions & 4 deletions e2e/knative/knative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestRunServiceCombo(t *testing.T) {

func TestRunChannelComboV1Beta1(t *testing.T) {
WithNewTestNamespace(t, func(ns string) {
Expect(CreateKnativeChannelv1Beta1(ns, "messages")()).To(Succeed())
Expect(CreateKnativeChannel(ns, "messages")()).To(Succeed())
Expect(Kamel("install", "-n", ns, "--trait-profile", "knative").Execute()).To(Succeed())
Expect(Kamel("run", "-n", ns, "files/knativech2.groovy").Execute()).To(Succeed())
Expect(Kamel("run", "-n", ns, "files/knativech1.groovy").Execute()).To(Succeed())
Expand All @@ -71,7 +71,7 @@ func TestRunChannelComboV1Beta1(t *testing.T) {

func TestRunChannelComboGetToPost(t *testing.T) {
WithNewTestNamespace(t, func(ns string) {
Expect(CreateKnativeChannelv1Beta1(ns, "messages")()).To(Succeed())
Expect(CreateKnativeChannel(ns, "messages")()).To(Succeed())
Expect(Kamel("install", "-n", ns, "--trait-profile", "knative").Execute()).To(Succeed())
Expect(Kamel("run", "-n", ns, "files/knativegetpost2.groovy").Execute()).To(Succeed())
Expect(Kamel("run", "-n", ns, "files/knativegetpost1.groovy").Execute()).To(Succeed())
Expand All @@ -84,8 +84,8 @@ func TestRunChannelComboGetToPost(t *testing.T) {

func TestRunMultiChannelChain(t *testing.T) {
WithNewTestNamespace(t, func(ns string) {
Expect(CreateKnativeChannelv1Beta1(ns, "messages")()).To(Succeed())
Expect(CreateKnativeChannelv1Beta1(ns, "words")()).To(Succeed())
Expect(CreateKnativeChannel(ns, "messages")()).To(Succeed())
Expect(CreateKnativeChannel(ns, "words")()).To(Succeed())
Expect(Kamel("install", "-n", ns, "--trait-profile", "knative").Execute()).To(Succeed())
Expect(Kamel("run", "-n", ns, "files/knativemultihop3.groovy").Execute()).To(Succeed())
Expect(Kamel("run", "-n", ns, "files/knativemultihop2.groovy").Execute()).To(Succeed())
Expand Down
6 changes: 3 additions & 3 deletions e2e/support/test_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ import (

ctrl "sigs.k8s.io/controller-runtime/pkg/client"

eventing "knative.dev/eventing/pkg/apis/eventing/v1beta1"
messaging "knative.dev/eventing/pkg/apis/messaging/v1beta1"
eventing "knative.dev/eventing/pkg/apis/eventing/v1"
messaging "knative.dev/eventing/pkg/apis/messaging/v1"
servingv1 "knative.dev/serving/pkg/apis/serving/v1"

projectv1 "github.com/openshift/api/project/v1"
Expand Down Expand Up @@ -1011,7 +1011,7 @@ func CreateKamelPod(ns string, name string, command ...string) error {
Knative
*/

func CreateKnativeChannelv1Beta1(ns string, name string) func() error {
func CreateKnativeChannel(ns string, name string) func() error {
return func() error {
channel := messaging.InMemoryChannel{
TypeMeta: metav1.TypeMeta{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
source:
ref:
kind: Broker
apiVersion: eventing.knative.dev/v1beta1
apiVersion: eventing.knative.dev/v1
name: default
properties:
type: custom-type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
sink:
ref:
kind: Broker
apiVersion: eventing.knative.dev/v1beta1
apiVersion: eventing.knative.dev/v1
name: default
properties:
type: custom-type
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
source:
ref:
kind: InMemoryChannel
apiVersion: messaging.knative.dev/v1beta1
apiVersion: messaging.knative.dev/v1
name: messages
sink:
ref:
Expand Down
4 changes: 2 additions & 2 deletions examples/kamelets/timer-source-log-sink/timer-events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: messaging.knative.dev/v1beta1
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
metadata:
name: messages
name: messages
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ spec:
sink:
ref:
kind: InMemoryChannel
apiVersion: messaging.knative.dev/v1beta1
name: messages
apiVersion: messaging.knative.dev/v1
name: messages
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ spec:
sink:
ref:
kind: InMemoryChannel
apiVersion: messaging.knative.dev/v1beta1
apiVersion: messaging.knative.dev/v1
name: messages
2 changes: 1 addition & 1 deletion examples/kamelets/timer-source/messages-channel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: messaging.knative.dev/v1beta1
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
metadata:
name: messages
2 changes: 1 addition & 1 deletion examples/knative/messages-channel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: messaging.knative.dev/v1beta1
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
metadata:
name: messages
2 changes: 1 addition & 1 deletion examples/knative/words-channel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
# ---------------------------------------------------------------------------

apiVersion: messaging.knative.dev/v1beta1
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
metadata:
name: words
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ require (
github.com/magiconair/properties v1.8.5
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.1.2
github.com/onsi/gomega v1.10.3
github.com/onsi/gomega v1.10.4
github.com/openshift/api v3.9.1-0.20190927182313-d4a64ec2cbd8+incompatible
github.com/operator-framework/api v0.3.8
github.com/pkg/errors v0.9.1
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.42.1
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/client_golang v1.10.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.15.0
github.com/prometheus/common v0.20.0
github.com/radovskyb/watcher v1.0.6
github.com/redhat-developer/service-binding-operator v0.7.1
github.com/rs/xid v1.2.1
github.com/scylladb/go-set v1.0.2
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
github.com/sirupsen/logrus v1.7.0
github.com/spf13/cobra v1.1.1
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.0
github.com/stoewer/go-strcase v1.2.0
github.com/stretchr/testify v1.6.1
go.uber.org/multierr v1.6.0
go.uber.org/zap v1.16.0
golang.org/x/oauth2 v0.0.0-20210126194326-f9ce19ea3013
golang.org/x/oauth2 v0.0.0-20210413134643-5e61552d6c78
gopkg.in/inf.v0 v0.9.1
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.20.2
Expand All @@ -53,9 +53,9 @@ require (
k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027
k8s.io/klog/v2 v2.8.0
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009
knative.dev/eventing v0.21.1
knative.dev/pkg v0.0.0-20210216013737-584933f8280b
knative.dev/serving v0.21.0
knative.dev/eventing v0.23.2
knative.dev/pkg v0.0.0-20210510175900-4564797bf3b7
knative.dev/serving v0.23.1
sigs.k8s.io/controller-runtime v0.8.3
)

Expand Down
Loading

0 comments on commit ef93dae

Please sign in to comment.