diff --git a/openshift/e2e-common.sh b/openshift/e2e-common.sh index 0e08891816a..5be26b63ce8 100644 --- a/openshift/e2e-common.sh +++ b/openshift/e2e-common.sh @@ -75,152 +75,28 @@ function timeout_non_zero() { return 0 } -function install_tracing { - deploy_zipkin - enable_eventing_tracing -} - -function deploy_zipkin { - logger.info "Installing Zipkin in namespace ${ZIPKIN_NAMESPACE}" - cat < ci - cat openshift/release/knative-eventing-mtbroker-ci.yaml >> ci + KNATIVE_EVENTING_MANIFESTS_DIR="$(pwd)/openshift/release/artifacts" + export KNATIVE_EVENTING_MANIFESTS_DIR - sed -i -e "s|registry.ci.openshift.org/openshift/knative-.*:knative-eventing-controller|${KNATIVE_EVENTING_CONTROLLER}|g" ci - sed -i -e "s|registry.ci.openshift.org/openshift/knative-.*:knative-eventing-mtping|${KNATIVE_EVENTING_MTPING}|g" ci - sed -i -e "s|registry.ci.openshift.org/openshift/knative-.*:knative-eventing-apiserver-receive-adapter|${KNATIVE_EVENTING_APISERVER_RECEIVE_ADAPTER}|g" ci - sed -i -e "s|registry.ci.openshift.org/openshift/knative-.*:knative-eventing-webhook|${KNATIVE_EVENTING_WEBHOOK}|g" ci - sed -i -e "s|registry.ci.openshift.org/openshift/knative-.*:knative-eventing-channel-controller|${KNATIVE_EVENTING_CHANNEL_CONTROLLER}|g" ci - sed -i -e "s|registry.ci.openshift.org/openshift/knative-.*:knative-eventing-channel-dispatcher|${KNATIVE_EVENTING_CHANNEL_DISPATCHER}|g" ci - sed -i -e "s|registry.ci.openshift.org/openshift/knative-.*:knative-eventing-mtbroker-ingress|${KNATIVE_EVENTING_MTBROKER_INGRESS}|g" ci - sed -i -e "s|registry.ci.openshift.org/openshift/knative-.*:knative-eventing-mtbroker-filter|${KNATIVE_EVENTING_MTBROKER_FILTER}|g" ci - sed -i -e "s|registry.ci.openshift.org/openshift/knative-.*:knative-eventing-mtchannel-broker|${KNATIVE_EVENTING_MTCHANNEL_BROKER}|g" ci - - oc apply -f ci || return 1 - rm ci - - # Wait for 5 pods to appear first - timeout_non_zero 900 '[[ $(oc get pods -n $EVENTING_NAMESPACE --no-headers | wc -l) -lt 5 ]]' || return 1 - wait_until_pods_running $EVENTING_NAMESPACE || return 1 - - # Apply the testing config for the sugar controller - configure_sugar_controller_testing - - # Assert that there are no images used that are not CI images (which should all be using the $INTERNAL_REGISTRY) - # (except for the knative-eventing-operator) - #oc get pod -n knative-eventing -o yaml | grep image: | grep -v knative-eventing-operator | grep -v ${INTERNAL_REGISTRY} && return 1 || true -} - -function uninstall_knative_eventing(){ - header "Uninstalling Knative Eventing" - - cat openshift/release/knative-eventing-ci.yaml > ci - cat openshift/release/knative-eventing-mtbroker-ci.yaml >> ci + local operator_dir=/tmp/serverless-operator + git clone --branch main https://github.com/openshift-knative/serverless-operator.git $operator_dir + export GOPATH=/tmp/go + local failed=0 + pushd $operator_dir || return $? + export ON_CLUSTER_BUILDS=true + export DOCKER_REPO_OVERRIDE=image-registry.openshift-image-registry.svc:5000/openshift-marketplace + OPENSHIFT_CI="true" TRACING_BACKEND="zipkin" ENABLE_TRACING="true" make generated-files images install-tracing install-eventing || failed=$? + cat ${operator_dir}/olm-catalog/serverless-operator/manifests/serverless-operator.clusterserviceversion.yaml + popd || return $? - oc delete -f ci --ignore-not-found=true || return 1 - rm ci + return $failed } function run_e2e_rekt_tests(){ header "Running E2E Reconciler Tests" - oc get ns ${SYSTEM_NAMESPACE} 2>/dev/null || SYSTEM_NAMESPACE="knative-eventing" - sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" ${CONFIG_TRACING_CONFIG} | oc replace -f - - - oc -n knative-eventing set env deployment/mt-broker-controller BROKER_INJECTION_DEFAULT=true || return 1 - wait_until_pods_running $EVENTING_NAMESPACE || return 2 - echo "Replacing images used in Rekt test resources with the images built in CI" echo "Replacing knative-eventing-test-event-library image" @@ -245,8 +121,6 @@ function run_e2e_rekt_tests(){ function run_e2e_tests(){ header "Running E2E tests with Multi Tenant Channel Based Broker" - oc get ns ${SYSTEM_NAMESPACE} 2>/dev/null || SYSTEM_NAMESPACE="knative-eventing" - sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" ${CONFIG_TRACING_CONFIG} | oc replace -f - local test_name="${1:-}" local run_command="" local failed=0 @@ -258,9 +132,6 @@ function run_e2e_tests(){ local run_command="-run ^(${test_name})$" fi - oc -n knative-eventing set env deployment/mt-broker-controller BROKER_INJECTION_DEFAULT=true || return 1 - wait_until_pods_running $EVENTING_NAMESPACE || return 2 - go_test_e2e -timeout=50m -parallel=20 ./test/e2e \ "$run_command" \ -brokerclass=MTChannelBasedBroker \ @@ -272,8 +143,6 @@ function run_e2e_tests(){ function run_conformance_tests(){ header "Running Conformance tests with Multi Tenant Channel Based Broker" - oc get ns ${SYSTEM_NAMESPACE} 2>/dev/null || SYSTEM_NAMESPACE="knative-eventing" - sed "s/namespace: ${KNATIVE_DEFAULT_NAMESPACE}/namespace: ${SYSTEM_NAMESPACE}/g" ${CONFIG_TRACING_CONFIG} | oc replace -f - local test_name="${1:-}" local run_command="" local failed=0 @@ -285,9 +154,6 @@ function run_conformance_tests(){ local run_command="-run ^(${test_name})$" fi - oc -n knative-eventing set env deployment/mt-broker-controller BROKER_INJECTION_DEFAULT=true || return 1 - wait_until_pods_running $EVENTING_NAMESPACE || return 2 - go_test_e2e -timeout=30m -parallel=12 ./test/conformance \ "$run_command" \ -brokerclass=MTChannelBasedBroker \ diff --git a/openshift/e2e-conformance-tests.sh b/openshift/e2e-conformance-tests.sh index 7d3c44c2742..ea5affbaebc 100644 --- a/openshift/e2e-conformance-tests.sh +++ b/openshift/e2e-conformance-tests.sh @@ -14,14 +14,8 @@ failed=0 (( !failed )) && install_serverless || failed=1 -(( !failed )) && install_knative_eventing || failed=1 - -(( !failed )) && install_tracing || failed=1 - (( !failed )) && run_conformance_tests || failed=1 -(( !failed )) && uninstall_knative_eventing || failed=1 - (( failed )) && dump_cluster_state (( failed )) && exit 1 diff --git a/openshift/e2e-rekt-tests.sh b/openshift/e2e-rekt-tests.sh index 1219f71d75e..4c0c1a4d9f6 100644 --- a/openshift/e2e-rekt-tests.sh +++ b/openshift/e2e-rekt-tests.sh @@ -14,14 +14,8 @@ failed=0 (( !failed )) && install_serverless || failed=1 -(( !failed )) && install_knative_eventing || failed=1 - -(( !failed )) && install_tracing || failed=1 - (( !failed )) && run_e2e_rekt_tests || failed=1 -(( !failed )) && uninstall_knative_eventing || failed=1 - (( failed )) && dump_cluster_state (( failed )) && exit 1 diff --git a/openshift/e2e-tests.sh b/openshift/e2e-tests.sh index ebc6fb7a1ec..cfd03fdcecd 100644 --- a/openshift/e2e-tests.sh +++ b/openshift/e2e-tests.sh @@ -14,14 +14,8 @@ failed=0 (( !failed )) && install_serverless || failed=1 -(( !failed )) && install_knative_eventing || failed=1 - -(( !failed )) && install_tracing || failed=1 - (( !failed )) && run_e2e_tests || failed=1 -(( !failed )) && uninstall_knative_eventing || failed=1 - (( failed )) && dump_cluster_state (( failed )) && exit 1 diff --git a/openshift/patches-knative-v1.0.0/005-k8s-min.patch b/openshift/patches-knative-v1.0.0/005-k8s-min.patch deleted file mode 100644 index 4693887fbdd..00000000000 --- a/openshift/patches-knative-v1.0.0/005-k8s-min.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/vendor/knative.dev/pkg/version/version.go b/vendor/knative.dev/pkg/version/version.go -index 3cbd846ea..81b1ba46a 100644 ---- a/vendor/knative.dev/pkg/version/version.go -+++ b/vendor/knative.dev/pkg/version/version.go -@@ -33,7 +33,7 @@ const ( - // NOTE: If you are changing this line, please also update the minimum kubernetes - // version listed here: - // https://github.com/knative/docs/blob/mkdocs/docs/snippets/prerequisites.md -- defaultMinimumVersion = "v1.20.0" -+ defaultMinimumVersion = "v1.19.0" - ) - - func getMinimumVersion() string { diff --git a/openshift/patches-knative-v1.0.0/013-sinkbinding_webhook_corrections.patch b/openshift/patches-knative-v1.0.0/013-sinkbinding_webhook_corrections.patch deleted file mode 100644 index 0b2fc7dd145..00000000000 --- a/openshift/patches-knative-v1.0.0/013-sinkbinding_webhook_corrections.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/config/core/deployments/webhook.yaml b/config/core/deployments/webhook.yaml -index a8dfef10b..71bbce864 100644 ---- a/config/core/deployments/webhook.yaml -+++ b/config/core/deployments/webhook.yaml -@@ -81,7 +81,7 @@ spec: - # will NOT be considered by the sinkbinding webhook. - # The default is `exclusion`. - - name: SINK_BINDING_SELECTION_MODE -- value: "exclusion" -+ value: "inclusion" - - name: POD_NAME - valueFrom: - fieldRef: diff --git a/openshift/patches-knative-v1.0.0/015-sinkbinding_v1_tests_skip.patch b/openshift/patches-knative-v1.0.0/015-sinkbinding_v1_tests_skip.patch deleted file mode 100644 index 8c8f24fc404..00000000000 --- a/openshift/patches-knative-v1.0.0/015-sinkbinding_v1_tests_skip.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/test/e2e/source_sinkbinding_v1_test.go b/test/e2e/source_sinkbinding_v1_test.go -index 456069539..8328b6b83 100644 ---- a/test/e2e/source_sinkbinding_v1_test.go -+++ b/test/e2e/source_sinkbinding_v1_test.go -@@ -126,6 +126,7 @@ func TestSinkBindingV1Deployment(t *testing.T) { - } - - func TestSinkBindingV1CronJob(t *testing.T) { -+ t.Skip("SRVKE-500: Skipping since we set bindings to inclusion") - const ( - sinkBindingName = "e2e-sink-binding" - deploymentName = "e2e-sink-binding-cronjob" diff --git a/openshift/patches-knative-v1.0.0/017-SourceCRDControllerFilterNonDucks.patch b/openshift/patches-knative-v1.0.0/017-SourceCRDControllerFilterNonDucks.patch deleted file mode 100644 index 41863cbf455..00000000000 --- a/openshift/patches-knative-v1.0.0/017-SourceCRDControllerFilterNonDucks.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 98030ddb62e1330830cd912b3c46f1ac0454c78b Mon Sep 17 00:00:00 2001 -From: Lukas Berk -Date: Tue, 17 Nov 2020 22:09:57 -0500 -Subject: [PATCH] source.crd controller: filter out non duck crds (#980) - -knative.dev/pkg controller runtime doesn't allow for global level -resync and leaderelection functions to filter out objects set by -filter funcs. In the case of the crd controller -- this means our -reconciliation process picks up unrelated objets to try and create -duck controllers. Add an extra check in the reconcile process -equivalent to the informer filterFunc ---- - pkg/reconciler/source/crd/crd.go | 7 +++++++ - pkg/reconciler/source/crd/crd_test.go | 21 ++++++++++++++++++--- - 2 files changed, 25 insertions(+), 3 deletions(-) - -diff --git a/pkg/reconciler/source/crd/crd.go b/pkg/reconciler/source/crd/crd.go -index acf4f0cb0..3215de54d 100644 ---- a/pkg/reconciler/source/crd/crd.go -+++ b/pkg/reconciler/source/crd/crd.go -@@ -31,6 +31,7 @@ import ( - "knative.dev/pkg/logging" - pkgreconciler "knative.dev/pkg/reconciler" - -+ "knative.dev/eventing/pkg/apis/sources" - "knative.dev/eventing/pkg/reconciler/source/duck" - ) - -@@ -60,6 +61,12 @@ func (r *Reconciler) ReconcileKind(ctx context.Context, crd *v1.CustomResourceDe - // 2. Dynamically create a controller for it, if not present already. Such controller is in charge of reconciling - // duckv1.Source resources with that particular GVR.. - -+ filterFunc := pkgreconciler.LabelFilterFunc(sources.SourceDuckLabelKey, sources.SourceDuckLabelValue, false) -+ if ok := filterFunc(crd); !ok { -+ logging.FromContext(ctx).Errorw("Passed crd does not have source duck label", zap.String("CRD", crd.Name)) -+ return nil //Avoid requeuing object -+ } -+ - gvr, gvk, err := r.resolveGroupVersions(crd) - if err != nil { - logging.FromContext(ctx).Errorw("Error while resolving GVR and GVK", zap.String("CRD", crd.Name), zap.Error(err)) -diff --git a/pkg/reconciler/source/crd/crd_test.go b/pkg/reconciler/source/crd/crd_test.go -index 890a31075..70db91375 100644 ---- a/pkg/reconciler/source/crd/crd_test.go -+++ b/pkg/reconciler/source/crd/crd_test.go -@@ -158,6 +158,23 @@ func TestAllCases(t *testing.T) { - Key: crdName, - Ctx: ctx, - }, -+ { -+ Name: "crd missing duck label", -+ Objects: []runtime.Object{ -+ NewCustomResourceDefinition(crdName, -+ WithCustomResourceDefinitionGroup(crdGroup), -+ WithCustomResourceDefinitionNames(apiextensionsv1.CustomResourceDefinitionNames{ -+ Kind: crdKind, -+ Plural: crdPlural, -+ }), -+ WithCustomResourceDefinitionVersions([]apiextensionsv1.CustomResourceDefinitionVersion{{ -+ Name: crdVersionServed, -+ Served: true, -+ }})), -+ }, -+ Key: crdName, -+ Ctx: ctx, -+ }, - } - - logger := logtesting.TestLogger(t) -@@ -184,9 +201,7 @@ func TestControllerRunning(t *testing.T) { - Name: "reconcile succeeded", - Objects: []runtime.Object{ - NewCustomResourceDefinition(crdName, -- WithCustomResourceDefinitionLabels(map[string]string{ -- sources.SourceDuckLabelKey: sources.SourceDuckLabelValue, -- }), -+ WithCustomResourceDefinitionLabels(map[string]string{sources.SourceDuckLabelKey: sources.SourceDuckLabelValue}), - WithCustomResourceDefinitionGroup(crdGroup), - WithCustomResourceDefinitionNames(apiextensionsv1.CustomResourceDefinitionNames{ - Kind: crdKind, --- -2.26.3 - diff --git a/openshift/patches-knative-v1.0.0/018-rekt-test-apiserversource_data_plane.patch b/openshift/patches-knative-v1.0.0/018-rekt-test-apiserversource_data_plane.patch deleted file mode 100644 index 1fa02c6395f..00000000000 --- a/openshift/patches-knative-v1.0.0/018-rekt-test-apiserversource_data_plane.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/test/rekt/features/apiserversource/data_plane.go b/test/rekt/features/apiserversource/data_plane.go -index 037281409..1c7a734dd 100644 ---- a/test/rekt/features/apiserversource/data_plane.go -+++ b/test/rekt/features/apiserversource/data_plane.go -@@ -37,7 +37,7 @@ import ( - ) - - const ( -- exampleImage = "ko://knative.dev/eventing/test/test_images/print" -+ exampleImage = "registry.ci.openshift.org/openshift/knative-nightly:knative-eventing-test-print" - ) - - func DataPlane_SinkTypes() *feature.FeatureSet { diff --git a/openshift/patches-knative-v1.0.0/018-rekt-test-image-changes.patch b/openshift/patches-knative-v1.0.0/018-rekt-test-image-changes.patch deleted file mode 100644 index 8608bd6c4f0..00000000000 --- a/openshift/patches-knative-v1.0.0/018-rekt-test-image-changes.patch +++ /dev/null @@ -1,112 +0,0 @@ -diff --git a/test/rekt/broker_test.go b/test/rekt/broker_test.go -index 3b01c8dc2..06d824591 100644 ---- a/test/rekt/broker_test.go -+++ b/test/rekt/broker_test.go -@@ -55,6 +55,7 @@ func TestBrokerAsMiddleware(t *testing.T) { - - // TestBrokerDLQ - func TestBrokerWithDLQ(t *testing.T) { -+ t.Skip("skipping for test reasons...") - ctx, env := global.Environment( - knative.WithKnativeNamespace(system.Namespace()), - knative.WithLoggingConfig, -diff --git a/test/rekt/resources/containersource/containersource.yaml b/test/rekt/resources/containersource/containersource.yaml -index f480b459b..51ebb5c82 100644 ---- a/test/rekt/resources/containersource/containersource.yaml -+++ b/test/rekt/resources/containersource/containersource.yaml -@@ -42,7 +42,7 @@ spec: - spec: - containers: - - name: heartbeats -- image: ko://knative.dev/eventing/test/test_images/heartbeats -+ image: registry.ci.openshift.org/openshift/knative-nightly:knative-eventing-test-heartbeats - args: - - --period=1 - env: -diff --git a/test/rekt/resources/containersource/containersource_test.go b/test/rekt/resources/containersource/containersource_test.go -index 501541bca..c2b81583a 100644 ---- a/test/rekt/resources/containersource/containersource_test.go -+++ b/test/rekt/resources/containersource/containersource_test.go -@@ -47,7 +47,7 @@ func Example_min() { - // spec: - // containers: - // - name: heartbeats -- // image: ko://knative.dev/eventing/test/test_images/heartbeats -+ // image: registry.ci.openshift.org/openshift/knative-nightly:knative-eventing-test-heartbeats - // args: - // - --period=1 - // env: -@@ -106,7 +106,7 @@ func Example_full() { - // spec: - // containers: - // - name: heartbeats -- // image: ko://knative.dev/eventing/test/test_images/heartbeats -+ // image: registry.ci.openshift.org/openshift/knative-nightly:knative-eventing-test-heartbeats - // args: - // - --period=1 - // env: -diff --git a/test/rekt/resources/eventlibrary/eventlibrary.yaml b/test/rekt/resources/eventlibrary/eventlibrary.yaml -index 7cd5e8e57..96777f69f 100644 ---- a/test/rekt/resources/eventlibrary/eventlibrary.yaml -+++ b/test/rekt/resources/eventlibrary/eventlibrary.yaml -@@ -23,7 +23,7 @@ spec: - restartPolicy: "Never" - containers: - - name: library -- image: ko://knative.dev/eventing/test/test_images/event-library -+ image: registry.ci.openshift.org/openshift/knative-nightly:knative-eventing-test-event-library - imagePullPolicy: "IfNotPresent" - - --- -diff --git a/test/rekt/resources/eventlibrary/eventlibrary_test.go b/test/rekt/resources/eventlibrary/eventlibrary_test.go -index 0e1464ddf..fe3b19c2e 100644 ---- a/test/rekt/resources/eventlibrary/eventlibrary_test.go -+++ b/test/rekt/resources/eventlibrary/eventlibrary_test.go -@@ -24,7 +24,7 @@ import ( - - func Example() { - images := map[string]string{ -- "ko://knative.dev/eventing/test/test_images/event-library": "gcr.io/knative-samples/helloworld-go", -+ "registry.ci.openshift.org/openshift/knative-nightly:knative-eventing-test-event-library": "gcr.io/knative-samples/helloworld-go", - } - cfg := map[string]interface{}{ - "name": "foo", -diff --git a/test/rekt/resources/flaker/flaker.yaml b/test/rekt/resources/flaker/flaker.yaml -index 207c3d681..8821bb577 100644 ---- a/test/rekt/resources/flaker/flaker.yaml -+++ b/test/rekt/resources/flaker/flaker.yaml -@@ -23,7 +23,7 @@ spec: - restartPolicy: "Never" - containers: - - name: flaker -- image: ko://knative.dev/eventing/test/test_images/event-flaker -+ image: registry.ci.openshift.org/openshift/knative-nightly:knative-eventing-test-event-flaker - imagePullPolicy: "IfNotPresent" - env: - - name: "K_SINK" -diff --git a/test/rekt/resources/flaker/flaker_test.go b/test/rekt/resources/flaker/flaker_test.go -index aee4d23c2..3d797342a 100644 ---- a/test/rekt/resources/flaker/flaker_test.go -+++ b/test/rekt/resources/flaker/flaker_test.go -@@ -24,7 +24,7 @@ import ( - - func Example() { - images := map[string]string{ -- "ko://knative.dev/eventing/test/test_images/event-flaker": "gcr.io/knative-samples/helloworld-go", -+ "registry.ci.openshift.org/openshift/knative-nightly:knative-eventing-test-event-flaker": "gcr.io/knative-samples/helloworld-go", - } - cfg := map[string]interface{}{ - "name": "foo", -diff --git a/vendor/knative.dev/reconciler-test/pkg/eventshub/103-pod.yaml b/vendor/knative.dev/reconciler-test/pkg/eventshub/103-pod.yaml -index fdf1bfe80..121012453 100644 ---- a/vendor/knative.dev/reconciler-test/pkg/eventshub/103-pod.yaml -+++ b/vendor/knative.dev/reconciler-test/pkg/eventshub/103-pod.yaml -@@ -24,7 +24,7 @@ spec: - restartPolicy: "Never" - containers: - - name: eventshub -- image: {{ .image }} -+ image: registry.ci.openshift.org/openshift/knative-nightly:knative-eventing-test-eventshub - imagePullPolicy: "IfNotPresent" - env: - - name: "SYSTEM_NAMESPACE" diff --git a/openshift/patches-knative-v1.0.0/018-rekt-test-override-kopublish.patch b/openshift/patches-knative-v1.0.0/018-rekt-test-override-kopublish.patch deleted file mode 100644 index 1dd36d9c7fa..00000000000 --- a/openshift/patches-knative-v1.0.0/018-rekt-test-override-kopublish.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/vendor/knative.dev/reconciler-test/pkg/images/ko.go b/vendor/knative.dev/reconciler-test/pkg/images/ko.go -index adde2080f..ff57c9d6b 100644 ---- a/vendor/knative.dev/reconciler-test/pkg/images/ko.go -+++ b/vendor/knative.dev/reconciler-test/pkg/images/ko.go -@@ -16,20 +16,7 @@ limitations under the License. - - package images - --import ( -- "fmt" -- "os" --) -- - // Use ko to publish the image. - func KoPublish(path string) (string, error) { -- platform := os.Getenv("PLATFORM") -- if len(platform) > 0 { -- platform = " --platform=" + platform -- } -- out, err := runCmd(fmt.Sprintf("ko publish%s -B %s", platform, path)) -- if err != nil { -- return "", err -- } -- return out, nil -+ return "", nil - } diff --git a/openshift/patches-knative-v1.0.0/018-rekt-test-skip-TestEventTransformationForSubscriptionV1.patch b/openshift/patches-knative-v1.0.0/018-rekt-test-skip-TestEventTransformationForSubscriptionV1.patch deleted file mode 100644 index a54ae1ccf67..00000000000 --- a/openshift/patches-knative-v1.0.0/018-rekt-test-skip-TestEventTransformationForSubscriptionV1.patch +++ /dev/null @@ -1,22 +0,0 @@ -From c529ba75353c9fd1ab30c1d04b07637f0a15c8f7 Mon Sep 17 00:00:00 2001 -From: Matthias Wessendorf -Date: Wed, 2 Jun 2021 08:50:38 +0200 -Subject: [PATCH] Trying to skip the failing test for more investigations - -Signed-off-by: Matthias Wessendorf ---- - test/rekt/channel_test.go | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/test/rekt/channel_test.go b/test/rekt/channel_test.go -index 3973c8f2b8..7e38a08b35 100644 ---- a/test/rekt/channel_test.go -+++ b/test/rekt/channel_test.go -@@ -192,6 +192,7 @@ EventSource ---> Channel ---> Subscription ---> Channel ---> Subscription ----> - -----------> Service(Transformation) - */ - func TestEventTransformationForSubscriptionV1(t *testing.T) { -+ t.Skip("skipping for now...") - t.Parallel() - - ctx, env := global.Environment( diff --git a/openshift/patches-knative-v1.0.0/019-remove-tracing-observability-yamls.patch b/openshift/patches-knative-v1.0.0/019-remove-tracing-observability-yamls.patch deleted file mode 100644 index 064d8f79b68..00000000000 --- a/openshift/patches-knative-v1.0.0/019-remove-tracing-observability-yamls.patch +++ /dev/null @@ -1,148 +0,0 @@ -diff --git a/config/channels/in-memory-channel/configmaps/observability.yaml b/config/channels/in-memory-channel/configmaps/observability.yaml -deleted file mode 100644 -index 9d1c67da7..000000000 ---- a/config/channels/in-memory-channel/configmaps/observability.yaml -+++ /dev/null -@@ -1,75 +0,0 @@ --# Copyright 2021 The Knative Authors -- --# Licensed under the Apache License, Version 2.0 (the "License"); --# you may not use this file except in compliance with the License. --# You may obtain a copy of the License at --# --# https://www.apache.org/licenses/LICENSE-2.0 --# --# Unless required by applicable law or agreed to in writing, software --# distributed under the License is distributed on an "AS IS" BASIS, --# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --# See the License for the specific language governing permissions and --# limitations under the License. -- --apiVersion: v1 --kind: ConfigMap --metadata: -- name: config-observability -- namespace: knative-eventing -- labels: -- eventing.knative.dev/release: devel -- knative.dev/config-propagation: original -- knative.dev/config-category: eventing -- app.kubernetes.io/version: devel -- app.kubernetes.io/part-of: knative-eventing -- annotations: -- knative.dev/example-checksum: "f46cf09d" --data: -- _example: | -- ################################ -- # # -- # EXAMPLE CONFIGURATION # -- # # -- ################################ -- -- # This block is not actually functional configuration, -- # but serves to illustrate the available configuration -- # options and document them in a way that is accessible -- # to users that `kubectl edit` this config map. -- # -- # These sample configuration options may be copied out of -- # this example block and unindented to be in the data block -- # to actually change the configuration. -- -- # metrics.backend-destination field specifies the system metrics destination. -- # It supports either prometheus (the default) or stackdriver. -- # Note: Using stackdriver will incur additional charges -- metrics.backend-destination: prometheus -- -- # metrics.request-metrics-backend-destination specifies the request metrics -- # destination. If non-empty, it enables queue proxy to send request metrics. -- # Currently supported values: prometheus, stackdriver. -- metrics.request-metrics-backend-destination: prometheus -- -- # metrics.stackdriver-project-id field specifies the stackdriver project ID. This -- # field is optional. When running on GCE, application default credentials will be -- # used if this field is not provided. -- metrics.stackdriver-project-id: "" -- -- # metrics.allow-stackdriver-custom-metrics indicates whether it is allowed to send metrics to -- # Stackdriver using "global" resource type and custom metric type if the -- # metrics are not supported by "knative_broker", "knative_trigger", and "knative_source" resource types. -- # Setting this flag to "true" could cause extra Stackdriver charge. -- # If metrics.backend-destination is not Stackdriver, this is ignored. -- metrics.allow-stackdriver-custom-metrics: "false" -- -- # profiling.enable indicates whether it is allowed to retrieve runtime profiling data from -- # the pods via an HTTP server in the format expected by the pprof visualization tool. When -- # enabled, the Knative Eventing pods expose the profiling data on an alternate HTTP port 8008. -- # The HTTP context root for profiling is then /debug/pprof/. -- profiling.enable: "false" -- -- # sink-event-error-reporting.enable whether the adapter reports a kube event to the CRD indicating -- # a failure to send a cloud event to the sink. -- sink-event-error-reporting.enable: "false" -diff --git a/config/channels/in-memory-channel/configmaps/tracing.yaml b/config/channels/in-memory-channel/configmaps/tracing.yaml -deleted file mode 100644 -index 30ac4974a..000000000 ---- a/config/channels/in-memory-channel/configmaps/tracing.yaml -+++ /dev/null -@@ -1,61 +0,0 @@ --# Copyright 2021 The Knative Authors --# --# Licensed under the Apache License, Version 2.0 (the "License"); --# you may not use this file except in compliance with the License. --# You may obtain a copy of the License at --# --# https://www.apache.org/licenses/LICENSE-2.0 --# --# Unless required by applicable law or agreed to in writing, software --# distributed under the License is distributed on an "AS IS" BASIS, --# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --# See the License for the specific language governing permissions and --# limitations under the License. -- --apiVersion: v1 --kind: ConfigMap --metadata: -- name: config-tracing -- namespace: knative-eventing -- labels: -- eventing.knative.dev/release: devel -- knative.dev/config-propagation: original -- knative.dev/config-category: eventing -- app.kubernetes.io/version: devel -- app.kubernetes.io/part-of: knative-eventing -- annotations: -- knative.dev/example-checksum: "4002b4c2" --data: -- _example: | -- ################################ -- # # -- # EXAMPLE CONFIGURATION # -- # # -- ################################ -- # This block is not actually functional configuration, -- # but serves to illustrate the available configuration -- # options and document them in a way that is accessible -- # to users that `kubectl edit` this config map. -- # -- # These sample configuration options may be copied out of -- # this example block and unindented to be in the data block -- # to actually change the configuration. -- # -- # This may be "zipkin" or "stackdriver", the default is "none" -- backend: "none" -- -- # URL to zipkin collector where traces are sent. -- # This must be specified when backend is "zipkin" -- zipkin-endpoint: "http://zipkin.istio-system.svc.cluster.local:9411/api/v2/spans" -- -- # The GCP project into which stackdriver metrics will be written -- # when backend is "stackdriver". If unspecified, the project-id -- # is read from GCP metadata when running on GCP. -- stackdriver-project-id: "my-project" -- -- # Enable zipkin debug mode. This allows all spans to be sent to the server -- # bypassing sampling. -- debug: "false" -- -- # Percentage (0-1) of requests to trace -- sample-rate: "0.1" diff --git a/openshift/patches-knative-v1.0.0/020-mutemetrics.patch b/openshift/patches-knative-v1.0.0/020-mutemetrics.patch deleted file mode 100644 index 8998b1685ae..00000000000 --- a/openshift/patches-knative-v1.0.0/020-mutemetrics.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/vendor/knative.dev/pkg/controller/stats_reporter.go b/vendor/knative.dev/pkg/controller/stats_reporter.go -index 6735285db..e1912daab 100644 ---- a/vendor/knative.dev/pkg/controller/stats_reporter.go -+++ b/vendor/knative.dev/pkg/controller/stats_reporter.go -@@ -199,7 +199,7 @@ func (r *reporter) ReportReconcile(duration time.Duration, success string, key t - return err - } - -- metrics.RecordBatch(ctx, reconcileCountStat.M(1), -- reconcileLatencyStat.M(duration.Milliseconds())) -+ // TODO skonto: fix latency histogram -+ metrics.RecordBatch(ctx, reconcileCountStat.M(1)) - return nil - } -diff --git a/vendor/knative.dev/pkg/webhook/stats_reporter.go b/vendor/knative.dev/pkg/webhook/stats_reporter.go -index 9d64634fe..d2845ac96 100644 ---- a/vendor/knative.dev/pkg/webhook/stats_reporter.go -+++ b/vendor/knative.dev/pkg/webhook/stats_reporter.go -@@ -99,9 +99,8 @@ func (r *reporter) ReportRequest(req *admissionv1.AdmissionRequest, resp *admiss - return err - } - -- metrics.RecordBatch(ctx, requestCountM.M(1), -- // Convert time.Duration in nanoseconds to milliseconds -- responseTimeInMsecM.M(float64(d.Milliseconds()))) -+ // TODO skonto: fix latency histogram -+ metrics.Record(ctx, requestCountM.M(1)) - return nil - } - diff --git a/openshift/patches/022-openshift-serverless-view-eventing-configmaps.patch b/openshift/patches/022-openshift-serverless-view-eventing-configmaps.patch new file mode 100644 index 00000000000..897113acdd9 --- /dev/null +++ b/openshift/patches/022-openshift-serverless-view-eventing-configmaps.patch @@ -0,0 +1,47 @@ +diff --git a/config/openshift-serverless-view-eventing-configmaps.yaml b/config/openshift-serverless-view-eventing-configmaps.yaml +new file mode 100644 +index 000000000..6f8fb0439 +--- /dev/null ++++ b/config/openshift-serverless-view-eventing-configmaps.yaml +@@ -0,0 +1,41 @@ ++# Copyright 2022 The Knative Authors ++# ++# Licensed under the Apache License, Version 2.0 (the "License"); ++# you may not use this file except in compliance with the License. ++# You may obtain a copy of the License at ++# ++# http://www.apache.org/licenses/LICENSE-2.0 ++# ++# Unless required by applicable law or agreed to in writing, software ++# distributed under the License is distributed on an "AS IS" BASIS, ++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++# See the License for the specific language governing permissions and ++# limitations under the License. ++apiVersion: rbac.authorization.k8s.io/v1 ++kind: Role ++metadata: ++ namespace: knative-eventing ++ name: openshift-serverless-view-eventing-configmaps ++rules: ++ - apiGroups: ++ - "" ++ resources: ++ - configmaps ++ verbs: ++ - get ++ - list ++ - watch ++--- ++kind: RoleBinding ++apiVersion: rbac.authorization.k8s.io/v1 ++metadata: ++ name: openshift-serverless-view-eventing-configmaps ++ namespace: knative-eventing ++subjects: ++ - kind: Group ++ name: system:authenticated ++ apiGroup: rbac.authorization.k8s.io ++roleRef: ++ apiGroup: rbac.authorization.k8s.io ++ kind: Role ++ name: openshift-serverless-view-eventing-configmaps diff --git a/openshift/patches/024-webhook-pdb.patch b/openshift/patches/024-webhook-pdb.patch new file mode 100644 index 00000000000..12980705d78 --- /dev/null +++ b/openshift/patches/024-webhook-pdb.patch @@ -0,0 +1,13 @@ +diff --git a/config/core/deployments/webhook-hpa.yaml b/config/core/deployments/webhook-hpa.yaml +index 45811e552..7483fd880 100644 +--- a/config/core/deployments/webhook-hpa.yaml ++++ b/config/core/deployments/webhook-hpa.yaml +@@ -49,7 +49,7 @@ metadata: + app.kubernetes.io/version: devel + app.kubernetes.io/name: knative-eventing + spec: +- minAvailable: 80% ++ minAvailable: 1 + selector: + matchLabels: + app: eventing-webhook diff --git a/openshift/release/generate-release.sh b/openshift/release/generate-release.sh index 5ea5c748838..f9ee64f7b46 100755 --- a/openshift/release/generate-release.sh +++ b/openshift/release/generate-release.sh @@ -4,50 +4,42 @@ source $(dirname $0)/resolve.sh release=$1 -output_file="openshift/release/knative-eventing-ci.yaml" +artifacts_dir="openshift/release/artifacts" +rm -rf $artifacts_dir +mkdir -p $artifacts_dir + +rm -rf config/channels/in-memory-channel/configmaps/observability.yaml +rm -rf config/channels/in-memory-channel/configmaps/tracing.yaml +rm -rf config/channels/in-memory-channel/100-namespace.yaml +rm -rf config/brokers/mt-channel-broker/deployments/hpa.yaml +rm -rf config/brokers/mt-channel-broker/hpa.yaml if [ "$release" == "ci" ]; then image_prefix="registry.ci.openshift.org/openshift/knative-nightly:knative-eventing-" tag="" else - image_prefix="registry.ci.openshift.org/openshift/${release}:knative-eventing-" + image_prefix="registry.ci.openshift.org/openshift/knative-${release}:knative-eventing-" tag="" fi -# the core parts -resolve_resources config/ $output_file $image_prefix $tag - -# InMemoryChannel folders... -# The root folder -resolve_resources config/channels/in-memory-channel/ crd-channel-resolved.yaml $image_prefix $tag -cat crd-channel-resolved.yaml >> $output_file -rm crd-channel-resolved.yaml - -# The configmaps folder -resolve_resources config/channels/in-memory-channel/configmaps crd-channel-resolved.yaml $image_prefix $tag -cat crd-channel-resolved.yaml >> $output_file -rm crd-channel-resolved.yaml - -# The deployments folder -resolve_resources config/channels/in-memory-channel/deployments crd-channel-resolved.yaml $image_prefix $tag -cat crd-channel-resolved.yaml >> $output_file -rm crd-channel-resolved.yaml - -# The resources folder -resolve_resources config/channels/in-memory-channel/resources crd-channel-resolved.yaml $image_prefix $tag -cat crd-channel-resolved.yaml >> $output_file -rm crd-channel-resolved.yaml - -# The roles folder -resolve_resources config/channels/in-memory-channel/roles crd-channel-resolved.yaml $image_prefix $tag -cat crd-channel-resolved.yaml >> $output_file -rm crd-channel-resolved.yaml - -# The webhooks folder -resolve_resources config/channels/in-memory-channel/webhooks crd-channel-resolved.yaml $image_prefix $tag -cat crd-channel-resolved.yaml >> $output_file -rm crd-channel-resolved.yaml - -# the MT Broker: -output_file="openshift/release/knative-eventing-mtbroker-ci.yaml" -resolve_resources config/brokers/mt-channel-broker/ $output_file $image_prefix $tag +eventing_core="${artifacts_dir}/eventing-core.yaml" +eventing_crds="${artifacts_dir}/eventing-crds.yaml" +in_memory_channel="${artifacts_dir}/in-memory-channel.yaml" +mt_channel_broker="${artifacts_dir}/mt-channel-broker.yaml" +eventing_post_install="${artifacts_dir}/eventing-post-install.yaml" + +# Eventing CRDs +resolve_resources config/core/resources "${eventing_crds}" "$image_prefix" "$tag" +# Eventing core +resolve_resources config "${eventing_core}" "$image_prefix" "$tag" +# Eventing post-install +resolve_resources config/post-install "${eventing_post_install}" "$image_prefix" "$tag" +# In memory channel +resolve_resources config/channels/in-memory-channel "${in_memory_channel}" "$image_prefix" "$tag" +resolve_resources config/channels/in-memory-channel/configmaps "${in_memory_channel}" "$image_prefix" "$tag" +resolve_resources config/channels/in-memory-channel/deployments "${in_memory_channel}" "$image_prefix" "$tag" +resolve_resources config/channels/in-memory-channel/resources "${in_memory_channel}" "$image_prefix" "$tag" +resolve_resources config/channels/in-memory-channel/roles "${in_memory_channel}" "$image_prefix" "$tag" +resolve_resources config/channels/in-memory-channel/webhooks "${in_memory_channel}" "$image_prefix" "$tag" +# MT Broker +resolve_resources config/brokers/mt-channel-broker "${mt_channel_broker}" "$image_prefix" "$tag" diff --git a/openshift/release/resolve.sh b/openshift/release/resolve.sh index d5e1537d9e5..5125ffa8d49 100755 --- a/openshift/release/resolve.sh +++ b/openshift/release/resolve.sh @@ -1,25 +1,29 @@ #!/usr/bin/env bash function resolve_resources(){ + echo $@ + local dir=$1 local resolved_file_name=$2 local image_prefix=$3 - local image_tag=$4 + local image_tag=${4-""} [[ -n $image_tag ]] && image_tag=":$image_tag" echo "Writing resolved yaml to $resolved_file_name" - > $resolved_file_name - for yaml in "$dir"/*.yaml; do - echo "---" >> $resolved_file_name + echo "Resolving ${yaml}" + + echo "---" >> "$resolved_file_name" # 1. Prefix test image references with test- # 2. Rewrite image references # 3. Remove comment lines # 4. Remove empty lines sed -e "s+\(.* image: \)\(knative.dev\)\(.*/\)\(test/\)\(.*\)+\1\2 \3\4test-\5+g" \ -e "s+ko://++" \ + -e "s+eventing.knative.dev/release: devel+eventing.knative.dev/release: ${release}+" \ + -e "s+app.kubernetes.io/version: devel+app.kubernetes.io/version: ${release}+" \ -e "s+knative.dev/eventing/cmd/broker/ingress+${image_prefix}mtbroker-ingress${image_tag}+" \ -e "s+knative.dev/eventing/cmd/broker/filter+${image_prefix}mtbroker-filter${image_tag}+" \ -e "s+knative.dev/eventing/cmd/mtbroker/ingress+${image_prefix}mtbroker-ingress${image_tag}+" \ @@ -32,8 +36,6 @@ function resolve_resources(){ -e "s+knative.dev/eventing/cmd/mtping+${image_prefix}mtping${image_tag}+" \ -e "s+knative.dev/eventing/cmd/apiserver_receive_adapter+${image_prefix}apiserver-receive-adapter${image_tag}+" \ -e "s+\(.* image: \)\(knative.dev\)\(.*/\)\(.*\)+\1${image_prefix}\4${image_tag}+g" \ - -e '/^[ \t]*#/d' \ - -e '/^[ \t]*$/d' \ - "$yaml" >> $resolved_file_name + "$yaml" >> "$resolved_file_name" done }