Skip to content

Commit

Permalink
Fix unable to deploy KafkaSink without Broker component (#716)
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <[email protected]>

Co-authored-by: Pierangelo Di Pilato <[email protected]>
  • Loading branch information
knative-prow-robot and pierDipi authored Mar 9, 2021
1 parent 4934e2f commit 8daeb77
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions data-plane/config/broker/100-config-logging.yaml
1 change: 1 addition & 0 deletions data-plane/config/broker/200-data-plane-cluster-role.yaml
1 change: 1 addition & 0 deletions data-plane/config/sink/100-config-logging.yaml
1 change: 1 addition & 0 deletions data-plane/config/sink/200-data-plane-cluster-role.yaml
1 change: 1 addition & 0 deletions data-plane/config/sink/200-data-plane-service-account.yaml
9 changes: 5 additions & 4 deletions hack/data-plane.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ readonly UUID=${UUID:-${TAG:-latest}}

readonly DATA_PLANE_DIR=data-plane
readonly DATA_PLANE_CONFIG_DIR=${DATA_PLANE_DIR}/config
readonly SINK_DATA_PLANE_CONFIG_DIR=${DATA_PLANE_CONFIG_DIR}/sink

# Broker config
readonly KAFKA_BROKER_DATA_PLANE_CONFIG_TEMPLATE_DIR=${DATA_PLANE_CONFIG_DIR}/template # no trailing slash
readonly BROKER_DATA_PLANE_CONFIG_DIR=${DATA_PLANE_CONFIG_DIR}/broker
readonly KAFKA_BROKER_DATA_PLANE_CONFIG_TEMPLATE_DIR=${BROKER_DATA_PLANE_CONFIG_DIR}/template # no trailing slash
readonly KAFKA_BROKER_DISPATCHER_TEMPLATE_FILE=${KAFKA_BROKER_DATA_PLANE_CONFIG_TEMPLATE_DIR}/500-dispatcher.yaml
readonly KAFKA_BROKER_RECEIVER_TEMPLATE_FILE=${KAFKA_BROKER_DATA_PLANE_CONFIG_TEMPLATE_DIR}/500-receiver.yaml

# Sink config
readonly KAFKA_SINK_DATA_PLANE_CONFIG_TEMPLATE_DIR=${DATA_PLANE_CONFIG_DIR}/sink/template
readonly SINK_DATA_PLANE_CONFIG_DIR=${DATA_PLANE_CONFIG_DIR}/sink
readonly KAFKA_SINK_DATA_PLANE_CONFIG_TEMPLATE_DIR=${SINK_DATA_PLANE_CONFIG_DIR}/template
readonly KAFKA_SINK_RECEIVER_TEMPLATE_FILE=${KAFKA_SINK_DATA_PLANE_CONFIG_TEMPLATE_DIR}/500-receiver.yaml

readonly receiver="${KNATIVE_KAFKA_BROKER_RECEIVER:-knative-kafka-broker-receiver}"
Expand Down Expand Up @@ -130,7 +131,7 @@ function k8s() {
echo "receiver image ---> ${KNATIVE_KAFKA_BROKER_RECEIVER_IMAGE}"
echo "receiver image ---> ${KNATIVE_KAFKA_SINK_RECEIVER_IMAGE}"

ko resolve ${KO_FLAGS} --strict -f ${DATA_PLANE_CONFIG_DIR} | "${LABEL_YAML_CMD[@]}" >>"${EVENTING_KAFKA_BROKER_ARTIFACT}"
ko resolve ${KO_FLAGS} --strict -f ${BROKER_DATA_PLANE_CONFIG_DIR} | "${LABEL_YAML_CMD[@]}" >>"${EVENTING_KAFKA_BROKER_ARTIFACT}"
ko resolve ${KO_FLAGS} --strict -f ${SINK_DATA_PLANE_CONFIG_DIR} | "${LABEL_YAML_CMD[@]}" >>"${EVENTING_KAFKA_SINK_ARTIFACT}"

sed "s|\${KNATIVE_KAFKA_BROKER_DISPATCHER_IMAGE}|${KNATIVE_KAFKA_BROKER_DISPATCHER_IMAGE}|g" ${KAFKA_BROKER_DISPATCHER_TEMPLATE_FILE} |
Expand Down
8 changes: 8 additions & 0 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,11 @@ function export_logs_continuously() {
kubectl logs -n ${SYSTEM_NAMESPACE} -f -l=app="$deployment" >"$ARTIFACTS/${SYSTEM_NAMESPACE}/$deployment" 2>&1 &
done
}

function save_release_artifacts() {
# Copy our release artifacts into artifacts, so that release artifacts of a PR can be tested and reviewed without
# building the project from source.
cp "${EVENTING_KAFKA_BROKER_ARTIFACT}" "${ARTIFACTS}/${EVENTING_KAFKA_BROKER_ARTIFACT}" || return $?
cp "${EVENTING_KAFKA_SINK_ARTIFACT}" "${ARTIFACTS}/${EVENTING_KAFKA_SINK_ARTIFACT}" || return $?
cp "${EVENTING_KAFKA_CONTROL_PLANE_ARTIFACT}" "${ARTIFACTS}/${EVENTING_KAFKA_CONTROL_PLANE_ARTIFACT}" || return $?
}
2 changes: 2 additions & 0 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ if ! ${SKIP_INITIALIZE}; then
initialize $@ --skip-istio-addon
fi

save_release_artifacts || fail_test "Failed to save release artifacts"

if ! ${LOCAL_DEVELOPMENT}; then
scale_controlplane kafka-controller kafka-webhook-eventing eventing-webhook eventing-controller
wait_until_pods_running knative-eventing || fail_test "Pods in knative-eventing didn't come up"
Expand Down

0 comments on commit 8daeb77

Please sign in to comment.