Skip to content
This repository was archived by the owner on Dec 1, 2022. It is now read-only.
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
29 changes: 9 additions & 20 deletions openshift/e2e-common.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

root="$(dirname "${BASH_SOURCE[0]}")"

# shellcheck disable=SC1090
source "$(dirname "$0")/../test/e2e-common.sh"
source "$(dirname "$0")/release/resolve.sh"
Expand Down Expand Up @@ -107,26 +109,10 @@ function update_csv(){
local KOURIER_VERSION=$(metadata.get dependencies.kourier)
local KOURIER_MINOR_VERSION=${KOURIER_VERSION%.*} # e.g. "0.21.0" => "0.21"

local KOURIER_CONTROL="registry.ci.openshift.org/openshift/knative-v${KOURIER_VERSION}:kourier"
local KOURIER_GATEWAY=$(grep -w "docker.io/maistra/proxyv2-ubi8" $SERVING_DIR/third_party/kourier-latest/kourier.yaml | awk '{print $NF}')
export KNATIVE_KOURIER_CONTROL="registry.ci.openshift.org/openshift/knative-v${KOURIER_VERSION}:kourier"
export KNATIVE_KOURIER_GATEWAY=$(grep -w "docker.io/maistra/proxyv2-ubi8" $SERVING_DIR/third_party/kourier-latest/kourier.yaml | awk '{print $NF}')
local CSV="olm-catalog/serverless-operator/manifests/serverless-operator.clusterserviceversion.yaml"

# Install CatalogSource in OLM namespace
# TODO: Rework this into a loop
sed -i -e "s|\"registry.ci.openshift.org/openshift/knative-.*:knative-serving-queue\"|\"${KNATIVE_SERVING_QUEUE}\"|g" ${CSV}
sed -i -e "s|\"registry.ci.openshift.org/openshift/knative-.*:knative-serving-activator\"|\"${KNATIVE_SERVING_ACTIVATOR}\"|g" ${CSV}
sed -i -e "s|\"registry.ci.openshift.org/openshift/knative-.*:knative-serving-autoscaler\"|\"${KNATIVE_SERVING_AUTOSCALER}\"|g" ${CSV}
sed -i -e "s|\"registry.ci.openshift.org/openshift/knative-.*:knative-serving-autoscaler-hpa\"|\"${KNATIVE_SERVING_AUTOSCALER_HPA}\"|g" ${CSV}
sed -i -e "s|\"registry.ci.openshift.org/openshift/knative-.*:knative-serving-controller\"|\"${KNATIVE_SERVING_CONTROLLER}\"|g" ${CSV}
sed -i -e "s|\"registry.ci.openshift.org/openshift/knative-.*:knative-serving-webhook\"|\"${KNATIVE_SERVING_WEBHOOK}\"|g" ${CSV}
sed -i -e "s|\"registry.ci.openshift.org/openshift/knative-.*:knative-serving-domain-mapping\"|\"${KNATIVE_SERVING_DOMAIN_MAPPING}\"|g" ${CSV}
sed -i -e "s|\"registry.ci.openshift.org/openshift/knative-.*:knative-serving-domain-mapping-webhook\"|\"${KNATIVE_SERVING_DOMAIN_MAPPING_WEBHOOK}\"|g" ${CSV}
sed -i -e "s|\"registry.ci.openshift.org/openshift/knative-.*:knative-serving-storage-version-migration\"|\"${KNATIVE_SERVING_STORAGE_VERSION_MIGRATION}\"|g" ${CSV}

# Replace kourier's image with the latest ones from third_party/kourier-latest
sed -i -e "s|\"docker.io/maistra/proxyv2-ubi8:.*\"|\"${KOURIER_GATEWAY}\"|g" ${CSV}
sed -i -e "s|\"registry.ci.openshift.org/openshift/knative-.*:kourier\"|\"${KOURIER_CONTROL}\"|g" ${CSV}

# release-next branch keeps updating the latest manifest in knative-serving-ci.yaml for serving resources.
# see: https://github.com/openshift/knative-serving/blob/release-next/openshift/release/knative-serving-ci.yaml
# So mount the manifest and use it by KO_DATA_PATH env value.
Expand Down Expand Up @@ -198,6 +184,8 @@ function install_catalogsource(){

source ./test/lib.bash
create_namespaces "${SYSTEM_NAMESPACES[@]}"
export GOPATH=/tmp/go
OPENSHIFT_CI="true" make generated-files || return $?
update_csv $CURRENT_DIR || return $?
# Make OPENSHIFT_CI non-empty to build the serverless index and use S-O nightly build images.
OPENSHIFT_CI="true" ensure_catalogsource_installed || return $?
Expand All @@ -208,6 +196,7 @@ function install_catalogsource(){

function install_knative(){
header "Installing Knative"
export KNATIVE_SERVING_TEST_MANIFESTS_DIR="${root}/release"
install_catalogsource || return $?
create_configmaps || return $?
deploy_serverless_operator "$CURRENT_CSV" || return $?
Expand Down Expand Up @@ -252,11 +241,11 @@ EOF

function create_configmaps(){
# Create configmap to use the latest manifest.
oc create configmap ko-data-serving -n $OPERATORS_NAMESPACE --from-file="openshift/release/knative-serving-ci.yaml" || return $?
oc create configmap ko-data-serving -n $OPERATORS_NAMESPACE --from-file="${KNATIVE_SERVING_TEST_MANIFESTS_DIR}/knative-serving-ci.yaml" || return $?

# Create eventing manifest. We don't want to do this, but upstream designed that knative-eventing dir is mandatory
# when KO_DATA_PATH was overwritten.
oc create configmap ko-data-eventing -n $OPERATORS_NAMESPACE --from-file="openshift/release/knative-eventing-ci.yaml" || return $?
oc create configmap ko-data-eventing -n $OPERATORS_NAMESPACE --from-file="${KNATIVE_SERVING_TEST_MANIFESTS_DIR}/knative-eventing-ci.yaml" || return $?
}

function prepare_knative_serving_tests_nightly {
Expand Down
Loading