Skip to content
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
2 changes: 1 addition & 1 deletion hack/lib/__sources__.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

declare -a __sources=(vars common ui scaleup namespaces catalogsource serverless)
declare -a __sources=(vars common ui scaleup namespaces catalogsource serverless tracing)

for source in "${__sources[@]}"; do
# shellcheck disable=SC1091,SC1090
Expand Down
2 changes: 1 addition & 1 deletion hack/lib/namespaces.bash
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function delete_namespaces {
for ns in "${NAMESPACES[@]}"; do
if oc get ns "${ns}" >/dev/null 2>&1; then
logger.info "Waiting until there are no pods in ${ns} to safely remove it..."
timeout 600 "[[ \$(oc get pods -n $ns -o jsonpath='{.items}') != '[]' ]]"
timeout 600 "[[ \$(oc get pods -n $ns --field-selector=status.phase!=Succeeded -o jsonpath='{.items}') != '[]' ]]"
oc delete ns "$ns"
fi
done
Expand Down
4 changes: 2 additions & 2 deletions hack/lib/serverless.bash
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ function teardown_serverless {
oc delete knativeserving.operator.knative.dev knative-serving -n "${SERVING_NAMESPACE}" || return $?
fi
logger.info 'Ensure no knative serving pods running'
timeout 600 "[[ \$(oc get pods -n ${SERVING_NAMESPACE} -o jsonpath='{.items}') != '[]' ]]" || return 9
timeout 600 "[[ \$(oc get pods -n ${SERVING_NAMESPACE} --field-selector=status.phase!=Succeeded -o jsonpath='{.items}') != '[]' ]]" || return 9

if oc get knativeeventing.operator.knative.dev knative-eventing -n "${EVENTING_NAMESPACE}" >/dev/null 2>&1; then
logger.info 'Removing KnativeEventing CR'
oc delete knativeeventing.operator.knative.dev knative-eventing -n "${EVENTING_NAMESPACE}" || return $?
fi
logger.info 'Ensure no knative eventing pods running'
timeout 600 "[[ \$(oc get pods -n ${EVENTING_NAMESPACE} -o jsonpath='{.items}') != '[]' ]]" || return 9
timeout 600 "[[ \$(oc get pods -n ${EVENTING_NAMESPACE} --field-selector=status.phase!=Succeeded -o jsonpath='{.items}') != '[]' ]]" || return 9

oc delete subscription -n "${OPERATORS_NAMESPACE}" "${OPERATOR}" 2>/dev/null
for ip in $(oc get installplan -n "${OPERATORS_NAMESPACE}" | grep serverless-operator | cut -f1 -d' '); do
Expand Down
90 changes: 90 additions & 0 deletions hack/lib/tracing.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/usr/bin/env bash

function install_tracing {
deploy_zipkin
enable_eventing_tracing
}

function deploy_zipkin {
logger.info "Installing Zipkin in namespace ${ZIPKIN_NAMESPACE}"
cat <<EOF | oc apply -f - || return $?
apiVersion: v1
kind: Service
metadata:
name: zipkin
namespace: ${ZIPKIN_NAMESPACE}
spec:
type: NodePort
ports:
- name: http
port: 9411
selector:
app: zipkin
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: zipkin
namespace: ${ZIPKIN_NAMESPACE}
spec:
replicas: 1
selector:
matchLabels:
app: zipkin
template:
metadata:
labels:
app: zipkin
annotations:
sidecar.istio.io/inject: "false"
spec:
containers:
- name: zipkin
image: docker.io/openzipkin/zipkin:latest
ports:
- containerPort: 9411
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
resources:
limits:
memory: 1000Mi
requests:
memory: 256Mi
---
EOF

logger.info "Waiting until Zipkin is available"
timeout 600 "[[ \$(oc get pods -n ${ZIPKIN_NAMESPACE} --field-selector=status.phase!=Succeeded -o jsonpath='{.items}') != '[]' ]]" || return 1
}

function enable_eventing_tracing {
header_text "Configuring tracing for Eventing"

cat <<EOF | oc apply -f - || return $?
apiVersion: v1
kind: ConfigMap
metadata:
name: config-tracing
namespace: ${EVENTING_NAMESPACE}
data:
enable: "true"
zipkin-endpoint: "http://zipkin.${ZIPKIN_NAMESPACE}.svc.cluster.local:9411/api/v2/spans"
sample-rate: "1.0"
debug: "true"
EOF
}

function teardown_tracing {
logger.warn 'Teardown tracing'

oc delete service -n ${ZIPKIN_NAMESPACE} zipkin
oc delete deployment -n ${ZIPKIN_NAMESPACE} zipkin

timeout 600 "[[ \$(oc get pods -n ${ZIPKIN_NAMESPACE} --field-selector=status.phase!=Succeeded -o jsonpath='{.items}') != '[]' ]]" || return 2

logger.success 'Tracing is uninstalled.'
}
2 changes: 1 addition & 1 deletion hack/lib/vars.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi
source "$(dirname "${BASH_SOURCE[0]}")/../../test/vendor/knative.dev/test-infra/scripts/e2e-tests.sh"

readonly KNATIVE_SERVING_VERSION="${KNATIVE_SERVING_VERSION:-v0.14.1}"
readonly KNATIVE_EVENTING_VERSION="${KNATIVE_EVENTING_VERSION:-v0.13.0}"
readonly KNATIVE_EVENTING_VERSION="${KNATIVE_EVENTING_VERSION:-v0.14.2}"

readonly KNATIVE_SERVING_BRANCH="${KNATIVE_SERVING_BRANCH:-release-${KNATIVE_SERVING_VERSION}}"
readonly KNATIVE_SERVING_REPO="${KNATIVE_SERVING_REPO:-"https://github.com/openshift/knative-serving.git"}"
Expand Down
15 changes: 3 additions & 12 deletions hack/teardown.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
#!/usr/bin/env bash

# This script can be used to teardown Serverless on a configured cluster.
#
# This script will:
#
# * Remove Knative Serving custom resource
# * Uninstall Serverless Operator
# * Remove Catalog Source
# * Unregister namespaces from Service Mesh and remove them
#

# shellcheck disable=SC1091,SC1090
source "$(dirname "${BASH_SOURCE[0]}")/lib/__sources__.bash"

Expand All @@ -18,7 +8,8 @@ set -Eeuo pipefail
exitcode=0

(( !exitcode )) && teardown_serverless || exitcode=2
(( !exitcode )) && delete_catalog_source || exitcode=3
(( !exitcode )) && delete_namespaces || exitcode=4
(( !exitcode )) && teardown_tracing || exitcode=3
(( !exitcode )) && delete_catalog_source || exitcode=4
(( !exitcode )) && delete_namespaces || exitcode=5

exit $exitcode
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ spec:
spec:
description: Spec defines the desired state of KnativeEventing
properties:
config:
additionalProperties:
additionalProperties:
type: string
type: object
description: A means to override the corresponding entries in the upstream
configmaps
type: object
registry:
description: A means to override the corresponding deployment images in the upstream.
This affects both apps/v1.Deployment and caching.internal.knative.dev/v1alpha1.Image.
Expand All @@ -64,6 +72,10 @@ spec:
name:
description: The name of the secret.
type: string
default-broker-class:
description: The default broker type to use for the brokers Knative creates.
If no value is provided, ChannelBasedBroker will be used.
type: string
type: object
status:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ spec:
fieldPath: metadata.namespace
- name: METRICS_DOMAIN
value: knative.dev/eventing-operator
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.3:knative-eventing-operator
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-operator
imagePullPolicy: IfNotPresent
name: knative-eventing-operator
ports:
Expand Down Expand Up @@ -355,28 +355,36 @@ spec:
value: docker.io/maistra/proxyv2-ubi8:1.0.8
- name: IMAGE_3scale-kourier-control
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.1:kourier
- name: IMAGE_eventing-controller
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-controller
- name: IMAGE_eventing-webhook
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-webhook
- name: IMAGE_broker-controller
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-channel-broker
- name: IMAGE_imc-controller
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-channel-controller
- name: IMAGE_imc-dispatcher
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-channel-dispatcher
- name: IMAGE_CRONJOB_RA_IMAGE
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-cronjob-receive-adapter
- name: IMAGE_eventing-controller__eventing-controller
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-controller
- name: IMAGE_eventing-webhook__eventing-webhook
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-webhook
- name: IMAGE_broker-controller__eventing-controller
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-channel-broker
- name: IMAGE_broker-filter__filter
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-mtbroker-filter
- name: IMAGE_broker-ingress__ingress
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-mtbroker-ingress
- name: IMAGE_mt-broker-controller__eventing-controller
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-mtchannel-broker
- name: IMAGE_imc-controller__controller
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-channel-controller
- name: IMAGE_imc-dispatcher__dispatcher
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-channel-dispatcher
- name: IMAGE_v0.14.0-upgrade__upgrade-brokers
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-upgrade-v0-14-0
- name: IMAGE_PING_IMAGE
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-ping
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-adapter
- name: IMAGE_JOB_RUNNER_IMAGE
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-jobrunner
- name: IMAGE_APISERVER_RA_IMAGE
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-apiserver-receive-adapter
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-apiserver-receive-adapter
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the eventing-controller pod, I do see that the ENV VAR for images, like the APISERVER_RA_IMAGE, is actually set to gcr.io, see:

Containers:
  eventing-controller:
    Container ID:   cri-o://3f4753bbf33611691b2dcd52285ff585affebdf4678cfd53e735df56635e7013
    Image:          registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-controller
    Image ID:       registry.svc.ci.openshift.org/openshift/knative-v0.14.2@sha256:075ef8a91762c68ea767cb9db0a71f1310ffa3e36ad292557a7b9a0853b42978
    Ports:          9090/TCP, 8008/TCP
    Host Ports:     0/TCP, 0/TCP
    State:          Running
      Started:      Wed, 10 Jun 2020 12:38:02 +0200
    Ready:          True
    Restart Count:  0
    Requests:
      cpu:     100m
      memory:  100Mi
    Environment:
      SYSTEM_NAMESPACE:           knative-eventing (v1:metadata.namespace)
      CONFIG_LOGGING_NAME:        config-logging
      CONFIG_OBSERVABILITY_NAME:  config-observability
      METRICS_DOMAIN:             knative.dev/eventing
      PING_IMAGE:                 gcr.io/knative-releases/knative.dev/eventing/cmd/ping/adapter@sha256:c7272752928f6eeb9a66cf47c00b2d295ffb8517f2033dbbc8a5f461f6adafc2
      JOB_RUNNER_IMAGE:           gcr.io/knative-releases/knative.dev/eventing/cmd/ping/jobrunner@sha256:b47877189b1e0f23c2617875574b16505251ae45ea091969332266621af99af8
      APISERVER_RA_IMAGE:         gcr.io/knative-releases/knative.dev/eventing/cmd/apiserver_receive_adapter@sha256:717e08da76235229c5664240351ece8c70767768437c0a6d498210cdcc182f14

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matzew are you sure that the deployment name is correct?

not the pod, deployment.

the syntax is IMAGE_<deployment_name>__<env_var>

- name: IMAGE_BROKER_INGRESS_IMAGE
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-ingress
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-broker-ingress
- name: IMAGE_BROKER_FILTER_IMAGE
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-filter
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-broker-filter
- name: IMAGE_DISPATCHER_IMAGE
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-channel-dispatcher
value: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-channel-dispatcher
- name: IMAGE_KN_CLI_ARTIFACTS
value: registry.svc.ci.openshift.org/openshift/knative-v0.13.2:kn-cli-artifacts
- name: knative-openshift-ingress
Expand Down Expand Up @@ -511,30 +519,38 @@ spec:
- name: knative-openshift-ingress
image: $IMAGE_KNATIVE_OPENSHIFT_INGRESS
- name: knative-eventing-operator
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.3:knative-eventing-operator
- name: IMAGE_eventing-controller
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-controller
- name: IMAGE_eventing-webhook
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-webhook
- name: IMAGE_broker-controller
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-channel-broker
- name: IMAGE_imc-controller
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-channel-controller
- name: IMAGE_imc-dispatcher
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-channel-dispatcher
- name: IMAGE_CRONJOB_RA_IMAGE
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-cronjob-receive-adapter
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-operator
- name: IMAGE_eventing-controller__eventing-controller
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-controller
- name: IMAGE_eventing-webhook__eventing-webhook
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-webhook
- name: IMAGE_broker-controller__eventing-controller
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-channel-broker
- name: IMAGE_broker-filter__filter
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-mtbroker-filter
- name: IMAGE_broker-ingress__ingress
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-mtbroker-ingress
- name: IMAGE_mt-broker-controller__eventing-controller
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-mtchannel-broker
- name: IMAGE_imc-controller__controller
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-channel-controller
- name: IMAGE_imc-dispatcher__dispatcher
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-channel-dispatcher
- name: IMAGE_v0.14.0-upgrade__upgrade-brokers
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-upgrade-v0-14-0
- name: IMAGE_PING_IMAGE
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-ping
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-adapter
- name: IMAGE_JOB_RUNNER_IMAGE
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-jobrunner
- name: IMAGE_APISERVER_RA_IMAGE
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-apiserver-receive-adapter
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-apiserver-receive-adapter
- name: IMAGE_BROKER_INGRESS_IMAGE
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-ingress
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-broker-ingress
- name: IMAGE_BROKER_FILTER_IMAGE
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-filter
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-broker-filter
- name: IMAGE_DISPATCHER_IMAGE
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.0:knative-eventing-channel-dispatcher
image: registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-channel-dispatcher
- name: IMAGE_KN_CLI_ARTIFACTS
image: registry.svc.ci.openshift.org/openshift/knative-v0.13.2:kn-cli-artifacts
replaces: serverless-operator.v1.7.0
version: 1.8.0
version: 1.8.0
2 changes: 1 addition & 1 deletion openshift/ci-operator/source-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM src

COPY oc /usr/bin/oc
COPY serving ${GOPATH}/src/knative.dev/serving
COPY eventing ${GOPATH}/src/knative.dev/eventing
COPY --from=registry.svc.ci.openshift.org/openshift/knative-v0.14.2:knative-eventing-src /go/src/knative.dev/eventing/ /go/src/knative.dev/eventing/
3 changes: 3 additions & 0 deletions test/e2e/knative_eventing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ const (

var knativeControlPlaneDeploymentNames = []string{
"broker-controller",
"broker-filter",
"broker-ingress",
"eventing-controller",
"eventing-webhook",
"imc-controller",
"imc-dispatcher",
"mt-broker-controller",
}

func TestKnativeEventing(t *testing.T) {
Expand Down
18 changes: 12 additions & 6 deletions test/eventing.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@

function knative_eventing_tests {
(
local exitstatus=0
local failed=0
logger.info 'Running eventing tests'

cd "$KNATIVE_EVENTING_HOME" || return $?

image_template="registry.svc.ci.openshift.org/openshift/knative-${KNATIVE_EVENTING_VERSION}:knative-eventing-test-{{.Name}}"

go_test_e2e -timeout=90m -parallel=1 ./test/e2e \
go_test_e2e -timeout=90m -parallel=12 ./test/e2e -brokerclass=ChannelBasedBroker -channels=messaging.knative.dev/v1alpha1:InMemoryChannel,messaging.knative.dev/v1alpha1:Channel,messaging.knative.dev/v1beta1:InMemoryChannel \
--kubeconfig "$KUBECONFIG" \
--imagetemplate "$image_template" \
|| exitstatus=$? && true
--imagetemplate "$image_template" || failed=1

print_test_result ${exitstatus}
oc patch cm config-br-defaults -n knative-eventing -p '{"data":{"default-br-config":"clusterDefault:\n brokerClass: MTChannelBasedBroker\n apiVersion: v1\n kind: ConfigMap\n name: config-br-default-channel\n namespace: knative-eventing\n"}}' --type=merge || failed=2

return $exitstatus
go_test_e2e -timeout=90m -parallel=12 ./test/e2e -brokerclass=MTChannelBasedBroker -channels=messaging.knative.dev/v1alpha1:InMemoryChannel,messaging.knative.dev/v1alpha1:Channel,messaging.knative.dev/v1beta1:InMemoryChannel \
--kubeconfig "$KUBECONFIG" \
--imagetemplate "$image_template" || failed=3


print_test_result ${failed}

return $failed
)
}
1 change: 1 addition & 0 deletions test/lib.bash
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function teardown {
fi
logger.warn "Teardown 💀"
teardown_serverless
teardown_tracing
delete_namespaces
delete_catalog_source
delete_users
Expand Down