Skip to content

Commit

Permalink
[RELEASE-1.6] Image injection (knative#1190)
Browse files Browse the repository at this point in the history
* [RELEASE-1.4] Inject images, generate manifests (knative#1169)

* inject images, generate manifests (knative#1150)

* Revert temoprary branch for image injection (knative#1159)

Co-authored-by: Kenjiro Nakayama <[email protected]>

* fixes for 1.6

* Kourier image injection (knative#1173)

* Revert temoprary branch for image injection (knative#1186)

Co-authored-by: Kenjiro Nakayama <[email protected]>
  • Loading branch information
skonto and nak3 authored Aug 1, 2022
1 parent acc3998 commit 12d9276
Show file tree
Hide file tree
Showing 10 changed files with 11,168 additions and 20 deletions.
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

0 comments on commit 12d9276

Please sign in to comment.