Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Manually bump to 1.36.0 #3060

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ assignees: ''
## Cutting the new release branch
- [ ] Create a new branch from `main` with the pattern `release-x.xx`
- [ ] [Approve CI setup for `release-1.X` branch in `openshift/release`](https://github.com/openshift/release/pulls/serverless-qe) and wait for the PR to be merged.
- [ ] [Approve PRs created by GitHub actions bot in `serverless-operator`](https://github.com/openshift-knative/serverless-operator/pulls/app%2Fgithub-actions)
- [ ] [Only for release-1.35+] [Revoke and recreate the token for the Konflux auto apply workflow](https://github.com/openshift-knative/hack/tree/main/cmd/konflux-apply#revoke-and-recreate-token)
- [ ] [Only for release-1.35+] [Approve PRs created by `serverless-qe` bot in `hack`](https://github.com/openshift-knative/hack/pulls/serverless-qe)
- [ ] wait for the PR to be merged
- [ ] wait for the [Generate CI config workflow to succeed](https://github.com/openshift-knative/hack/actions/workflows/release-generate-ci.yaml?query=event%3Apush++)
- [ ] [Approve Konflux-related PRs created by `serverless-qe`](https://github.com/pulls?q=is%3Aopen+is%3Apr+author%3Aserverless-qe+archived%3Afalse+%22Konflux%22) and wait for the PR to be merged.
- [ ] Wait for the PRs to be merged
- [ ] [Approve PRs created by GitHub actions bot in `serverless-operator`](https://github.com/openshift-knative/serverless-operator/pulls/app%2Fgithub-actions)
- [ ] Verify that [`knative-istio-authz-chart`](https://github.com/openshift-knative/knative-istio-authz-chart/branches) has a branch with the same name as the `release-1.X` branch created previously in serverless-operator
- [ ] Verify that [`knative-istio-authz-chart`'s `Chart.yaml`](https://github.com/openshift-knative/knative-istio-authz-chart/blob/main/Chart.yaml) has `version` and `appVersion` set to the next version.

Expand Down
2 changes: 1 addition & 1 deletion .tekton/serverless-bundle-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: '{{revision}}'
- name: additional-tags
value:
- 1.35.0
- 1.36.0
- latest
- name: prefetch-input
value: '[{"type":"rpm"}]'
Expand Down
2 changes: 1 addition & 1 deletion .tekton/serverless-index-136-fbc-414-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
value: '{{revision}}'
- name: additional-tags
value:
- 1.35.0
- 1.36.0
- latest
pipelineRef:
name: fbc-builder
Expand Down
2 changes: 1 addition & 1 deletion .tekton/serverless-index-136-fbc-415-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
value: '{{revision}}'
- name: additional-tags
value:
- 1.35.0
- 1.36.0
- latest
pipelineRef:
name: fbc-builder
Expand Down
2 changes: 1 addition & 1 deletion .tekton/serverless-index-136-fbc-416-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
value: '{{revision}}'
- name: additional-tags
value:
- 1.35.0
- 1.36.0
- latest
pipelineRef:
name: fbc-builder
Expand Down
2 changes: 1 addition & 1 deletion .tekton/serverless-index-136-fbc-417-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
value: '{{revision}}'
- name: additional-tags
value:
- 1.35.0
- 1.36.0
- latest
pipelineRef:
name: fbc-builder
Expand Down
2 changes: 1 addition & 1 deletion .tekton/serverless-index-136-fbc-418-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
value: '{{revision}}'
- name: additional-tags
value:
- 1.35.0
- 1.36.0
- latest
pipelineRef:
name: fbc-builder
Expand Down
2 changes: 1 addition & 1 deletion .tekton/serverless-ingress-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: '{{revision}}'
- name: additional-tags
value:
- 1.35.0
- 1.36.0
- latest
- name: prefetch-input
value: '[{"type":"rpm"}]'
Expand Down
2 changes: 1 addition & 1 deletion .tekton/serverless-kn-operator-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: '{{revision}}'
- name: additional-tags
value:
- 1.35.0
- 1.36.0
- latest
- name: prefetch-input
value: '[{"type":"rpm"}]'
Expand Down
2 changes: 1 addition & 1 deletion .tekton/serverless-metadata-webhook-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: '{{revision}}'
- name: additional-tags
value:
- 1.35.0
- 1.36.0
- latest
- name: prefetch-input
value: '[{"type":"rpm"}]'
Expand Down
2 changes: 1 addition & 1 deletion .tekton/serverless-must-gather-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: '{{revision}}'
- name: additional-tags
value:
- 1.35.0
- 1.36.0
- latest
- name: prefetch-input
value: '[{"type":"rpm"}]'
Expand Down
2 changes: 1 addition & 1 deletion .tekton/serverless-openshift-kn-operator-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
value: '{{revision}}'
- name: additional-tags
value:
- 1.35.0
- 1.36.0
- latest
- name: prefetch-input
value: '[{"type":"rpm"}]'
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,14 @@ generate-dockerfiles: install-tool-generate
# Generates all files that can be generated, includes release files, code generation
# and updates vendoring.
# Use CURRENT_VERSION_IMAGES="<branch>" if you need to override the defaulting to main
generated-files: update-tekton-pipelines install-tools generate-dockerfiles release-files
generated-files: install-tools generate-dockerfiles release-files
./hack/update-deps.sh
./hack/update-codegen.sh
(cd knative-operator && ./hack/update-manifests.sh)
(cd openshift-knative-operator && ./hack/update-manifests.sh)
(cd olm-catalog/serverless-operator && ./hack/update-manifests.sh)
./hack/update-deps.sh

update-tekton-pipelines:
./hack/generate/update-pipelines.sh

generated-files-release-next: release-files
# Re-generate CSV with release-next images
USE_RELEASE_NEXT=true ./hack/generate/csv.sh \
Expand Down
5 changes: 4 additions & 1 deletion hack/generate/catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,7 @@ logger.info "Generating catalog"
generate_catalog

logger.info "Generating ImageContextSourcePolicy"
create_image_content_source_policy "${INDEX_IMAGE}" "$registry_redhat_io" "$registry_quay" "olm-catalog/serverless-operator-index/image_content_source_policy.yaml"

default_serverless_operator_images
# shellcheck disable=SC2154
create_image_content_source_policy "${INDEX_IMAGE}" "$registry_redhat_io" "$registry_quay" "$registry_quay_previous" "olm-catalog/serverless-operator-index/image_content_source_policy.yaml"
3 changes: 3 additions & 0 deletions hack/generate/csv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -Eeuo pipefail

template="${1:?Provide template file as arg[1]}"
target="${2:?Provide a target CSV file as arg[2]}"
force_use_quay_images=${3:-"false"}

export FORCE_USE_QUAY_IMAGES="${force_use_quay_images}"

# shellcheck disable=SC1091,SC1090
source "$(dirname "${BASH_SOURCE[0]}")/../lib/common.bash"
Expand Down
7 changes: 0 additions & 7 deletions hack/generate/dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ if [[ "$template" =~ index.Dockerfile ]]; then
sed --in-place "/opm render/a registry.ci.openshift.org/knative/release-${current_version}:serverless-bundle \\\\" "$target"
done

# Hacks. Should gradually go away with next versions.
# Workaround for https://issues.redhat.com/browse/SRVCOM-3207
# Use a manually built image for 1.32.0.
# TODO: Remove this when 1.32.0 is not included in index. This is a problem only for 1.32.0.
sed --in-place "s|registry.ci.openshift.org/knative/release-1.32.0:serverless-bundle|quay.io/openshift-knative/serverless-bundle:release-1.32.0|" "$target"
# Replace the old format for 1.31.0 and older.
sed --in-place "s|registry.ci.openshift.org/knative/release-1.31.0:serverless-bundle|registry.ci.openshift.org/knative/openshift-serverless-v1.31.0:serverless-bundle|" "$target"
pierDipi marked this conversation as resolved.
Show resolved Hide resolved
elif [[ "$template" =~ catalog.Dockerfile ]]; then
while IFS=$'\n' read -r ocp_version; do
values[OCP_VERSION]="${ocp_version}"
Expand Down
7 changes: 0 additions & 7 deletions hack/generate/images-rekt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@ target="${2:?Provide a target file as arg[2]}"
source "$(dirname "${BASH_SOURCE[0]}")/../lib/images.bash"

default_knative_eventing_images
default_knative_eventing_istio_images
default_knative_eventing_kafka_broker_images
default_knative_backstage_plugins_images
default_knative_serving_images
default_knative_ingress_images
default_knative_kn_plugin_func_images
default_knative_client_images
pierDipi marked this conversation as resolved.
Show resolved Hide resolved

envsubst < "$template" > "$target"
7 changes: 0 additions & 7 deletions hack/generate/update-pipelines.sh

This file was deleted.

34 changes: 16 additions & 18 deletions hack/lib/catalogsource.bash
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function install_catalogsource {
# unless overridden by FORCE_KONFLUX_INDEX.
if { [ -n "$OPENSHIFT_CI" ] || [ -n "$DOCKER_REPO_OVERRIDE" ]; } && [ -z "${FORCE_KONFLUX_INDEX:-}" ]; then
index_image=image-registry.openshift-image-registry.svc:5000/$OLM_NAMESPACE/serverless-index:latest
bundle_image=image-registry.openshift-image-registry.svc:5000/$OLM_NAMESPACE/serverless-bundle:latest
rootdir="$(dirname "$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")")"

csv="${rootdir}/olm-catalog/serverless-operator/manifests/serverless-operator.clusterserviceversion.yaml"
Expand All @@ -42,13 +43,10 @@ function install_catalogsource {
fi

# Generate CSV from template to properly substitute operator images from env variables.
"${rootdir}/hack/generate/csv.sh" templates/csv.yaml "$csv"

# Replace registry.redhat.io references with Konflux quay.io for test purposes as
#
# Pass "true" to replace registry.redhat.io references with Konflux quay.io for test purposes as
# images in the former location are not published yet.
sed -ri "s#(.*)${registry_redhat_io}/(.*@sha[0-9]+:[a-z0-9]+.*)#\1${registry_quay}/\2#" "$csv"
# Remove rhel suffix.
sed -ri "s#(.*${registry_quay}/.*)-rhel[[:digit:]]+(.*)#\1\2#" "$csv"
"${rootdir}/hack/generate/csv.sh" templates/csv.yaml "$csv" "true"

cat "$csv"

Expand All @@ -73,13 +71,8 @@ function install_catalogsource {
cp "${index_dorkerfile_path}" "${rootdir}/_output/bkp.Dockerfile"

# Replace bundle reference with previously built bundle
bundle="${DEFAULT_SERVERLESS_BUNDLE%:*}" # Remove the tag from the match
bundle="${DEFAULT_SERVERLESS_BUNDLE%@*}" # Remove the sha from the match
if ! grep "${bundle}" "${rootdir}/${index_dorkerfile_path}"; then
logger.error "Bundle ${bundle} not found in Dockerfile."
return 1
fi
sed -ri "s#(.*)(${bundle})(:[a-z0-9]*)?(@sha[0-9]+:[a-z0-9]+)?(.*)#\1image-registry.openshift-image-registry.svc:5000/${OLM_NAMESPACE}/serverless-bundle:latest\5#" "${rootdir}/${index_dorkerfile_path}"
export SERVERLESS_BUNDLE="${bundle_image}"
"${rootdir}/hack/generate/dockerfile.sh" "${rootdir}/templates/index.Dockerfile" "${index_dorkerfile_path}"

build_image "serverless-index" "${rootdir}" "${index_dorkerfile_path}"

Expand All @@ -89,7 +82,8 @@ function install_catalogsource {
tmpfile=$(mktemp /tmp/icsp.XXXXXX.yaml)
# Use ImageContentSourcePolicy only with the FBC from Konflux as
# updating machine config pools takes a while.
create_image_content_source_policy "$index_image" "$registry_redhat_io" "$registry_quay" "$tmpfile"
# shellcheck disable=SC2154
create_image_content_source_policy "$index_image" "$registry_redhat_io" "$registry_quay" "$registry_quay_previous" "$tmpfile"
[ -n "$OPENSHIFT_CI" ] && cat "$tmpfile"
if oc apply -f "$tmpfile"; then
echo "Wait for machineconfigpool update to start"
Expand Down Expand Up @@ -129,7 +123,8 @@ function create_image_content_source_policy {
index="${1:?Pass index image as arg[1]}"
registry_source="${2:?Pass source registry arg[2]}"
registry_target="${3:?Pass target registry arg[3]}"
output_file="${4:?Pass output file arg[4]}"
registry_target_previous="${4:?Pass previous target registry arg[4]}"
output_file="${5:?Pass output file arg[5]}"

logger.info "Install ImageContentSourcePolicy"
cat > "$output_file" <<EOF
Expand Down Expand Up @@ -170,18 +165,21 @@ EOF
target_img=${img%-rhel*}
fi

add_repository_digest_mirrors "$output_file" "${registry_source}/${img}" "${registry_target}/${target_img}"
local mirror1="${registry_target}/${target_img}"
local mirror2="${registry_target_previous}/${target_img}"

add_repository_digest_mirrors "$output_file" "${registry_source}/${img}" "${mirror1}" "${mirror2}"
fi
done <<< "$mirrors"
}

function add_repository_digest_mirrors {
echo "Add mirror image to '${1}' - $2 = $3"
echo "Add mirror image to '${1}' - $2 = $3, $4"
cat << EOF | yq write --inplace --script - "$1"
- command: update
path: spec.repositoryDigestMirrors[+]
value:
mirrors: [ "${3}" ]
mirrors: [ "${3}", "${4}" ]
source: "${2}"
EOF
}
Expand Down
Loading