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
2 changes: 1 addition & 1 deletion .tekton/serverless-bundle-135-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-135-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-135-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-135-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-135-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-135-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-135-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-135-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-135-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-135-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-135-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: 2 additions & 0 deletions hack/generate/csv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -Eeuo pipefail

set -x

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

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"
44 changes: 33 additions & 11 deletions hack/lib/images.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,21 @@ function default_serverless_operator_images() {
local ocp_version
local serverless_registry="${registry_quay}/serverless"

export SERVERLESS_KNATIVE_OPERATOR=${SERVERLESS_KNATIVE_OPERATOR:-$(latest_registry_redhat_io_image_sha "${serverless_registry}-kn-operator:${CURRENT_VERSION_IMAGES}")}
export SERVERLESS_OPENSHIFT_KNATIVE_OPERATOR=${SERVERLESS_OPENSHIFT_KNATIVE_OPERATOR:-$(latest_registry_redhat_io_image_sha "${serverless_registry}-openshift-kn-operator:${CURRENT_VERSION_IMAGES}")}
export SERVERLESS_INGRESS=${SERVERLESS_INGRESS:-$(latest_registry_redhat_io_image_sha "${serverless_registry}-ingress:${CURRENT_VERSION_IMAGES}")}
export SERVERLESS_MUST_GATHER=${SERVERLESS_MUST_GATHER:-$(latest_registry_redhat_io_image_sha "${serverless_registry}-must-gather:${CURRENT_VERSION_IMAGES}")}
# When we bump the metadata for a major version, images are not yet available for SO components on
# the Konflux registry, so we use the `:latest` tag temporarily by passing "true" as argument to
# various `latest_*` functions.
#
# Eventually, once images are available, SHAs will be replaced/used.

export SERVERLESS_KNATIVE_OPERATOR=${SERVERLESS_KNATIVE_OPERATOR:-$(latest_registry_redhat_io_image_sha "${serverless_registry}-kn-operator:${CURRENT_VERSION_IMAGES}" "true")}
export SERVERLESS_OPENSHIFT_KNATIVE_OPERATOR=${SERVERLESS_OPENSHIFT_KNATIVE_OPERATOR:-$(latest_registry_redhat_io_image_sha "${serverless_registry}-openshift-kn-operator:${CURRENT_VERSION_IMAGES}" "true")}
export SERVERLESS_INGRESS=${SERVERLESS_INGRESS:-$(latest_registry_redhat_io_image_sha "${serverless_registry}-ingress:${CURRENT_VERSION_IMAGES}" "true")}
export SERVERLESS_MUST_GATHER=${SERVERLESS_MUST_GATHER:-$(latest_registry_redhat_io_image_sha "${serverless_registry}-must-gather:${CURRENT_VERSION_IMAGES}" "true")}

export SERVERLESS_BUNDLE=${SERVERLESS_BUNDLE:-$(get_bundle_for_version "${CURRENT_VERSION}")}
export DEFAULT_SERVERLESS_BUNDLE=${DEFAULT_SERVERLESS_BUNDLE:-$(get_bundle_for_version "${CURRENT_VERSION}")}

SERVERLESS_BUNDLE_REDHAT_IO=${SERVERLESS_BUNDLE_REDHAT_IO:-$(latest_registry_redhat_io_image_sha "${serverless_registry}-bundle:${CURRENT_VERSION_IMAGES}")}
SERVERLESS_BUNDLE_REDHAT_IO=${SERVERLESS_BUNDLE_REDHAT_IO:-$(latest_registry_redhat_io_image_sha "${serverless_registry}-bundle:${CURRENT_VERSION_IMAGES}" "true")}
# Bundle image is in different locations in quay.io and registry.redhat.io
export SERVERLESS_BUNDLE_REDHAT_IO=${SERVERLESS_BUNDLE_REDHAT_IO//serverless-bundle/serverless-operator-bundle}

Expand All @@ -44,7 +50,7 @@ function default_serverless_operator_images() {
fi
ocp_version=${ocp_version/./} # 4.17 -> 417

export INDEX_IMAGE=${INDEX_IMAGE:-$(latest_konflux_image_sha "${registry_quay}-fbc-${ocp_version}/serverless-index-${quay_registry_app_version}-fbc-${ocp_version}:${CURRENT_VERSION_IMAGES}")}
export INDEX_IMAGE=${INDEX_IMAGE:-$(latest_konflux_image_sha "${registry_quay}-fbc-${ocp_version}/serverless-index-${quay_registry_app_version}-fbc-${ocp_version}:${CURRENT_VERSION_IMAGES}" "latest" "true")}
}

# Bundle image is specific as we need to pull older versions for including in the catalog.
Expand Down Expand Up @@ -287,17 +293,27 @@ function default_knative_backstage_plugins_images() {

function latest_registry_redhat_io_image_sha() {
input=${1:?"Provide image"}
return_input_on_empty=${2:-"false"}

image_without_tag=${input%:*} # Remove tag, if any
image_without_tag=${image_without_tag%@*} # Remove sha, if any

image=$(image_with_sha "${image_without_tag}:latest")
image=$(image_with_sha "${image_without_tag}:latest" "${return_input_on_empty}")

if [ "${image}" = "" ]; then
exit 1
fi

digest="${image##*@}" # Get only sha
if [[ "$image" == *@* ]]; then
suffix="@${image##*@}" # Extract the sha
else
if [ "${return_input_on_empty}" = "true" ]; then
suffix=":latest" # No @, set suffix to `:latest` tag
else
echo "Digest is empty and for this image ${image} a digest is expected"
exit 1
fi
fi

image_name=${image_without_tag##*/} # Get image name after last slash

Expand All @@ -314,17 +330,18 @@ function latest_registry_redhat_io_image_sha() {
image_name="${image_name}-rhel$(get_serverless_operator_rhel_version)"
fi

echo "${registry_redhat_io}/${image_name}@${digest}"
echo "${registry_redhat_io}/${image_name}${suffix}"
}

function latest_konflux_image_sha() {
input=${1:?"Provide image"}
tag=${2:-"latest"}
return_input_on_empty=${3:-"false"}

image_without_tag=${input%:*} # Remove tag, if any
image_without_tag=${image_without_tag%@*} # Remove sha, if any

image=$(image_with_sha "${image_without_tag}:${tag}")
image=$(image_with_sha "${image_without_tag}:${tag}" "${return_input_on_empty}")

if [ "${image}" = "" ]; then
exit 1
Expand All @@ -335,10 +352,15 @@ function latest_konflux_image_sha() {

function image_with_sha {
image=${1:?"Provide image"}
return_input_on_empty=${2:-"false"}

digest=$(skopeo inspect --no-tags=true "docker://${image}" | jq -r '.Digest')
digest=$(skopeo inspect --no-tags=true "docker://${image}" | jq -r '.Digest' || echo "")
if [ "${digest}" = "" ]; then
if [ "${return_input_on_empty}" = "true" ]; then
echo "${image}"
fi
echo ""
return
fi

image_without_tag=${image%:*} # Remove tag, if any
Expand Down
2 changes: 1 addition & 1 deletion must-gather/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ USER 65532
LABEL \
com.redhat.component="openshift-serverless-1-must-gather-rhel8-container" \
name="openshift-serverless-1/svls-must-gather-rhel8" \
version=1.35.0 \
version=1.36.0 \
summary="Red Hat OpenShift Serverless 1 Must Gather" \
maintainer="[email protected]" \
description="Red Hat OpenShift Serverless 1 Must Gather" \
Expand Down
8 changes: 2 additions & 6 deletions olm-catalog/serverless-operator-index/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ COPY olm-catalog/serverless-operator-index/configs /configs

RUN /bin/opm init serverless-operator --default-channel=stable --output yaml >> /configs/index.yaml
RUN /bin/opm render --skip-tls-verify -o yaml \
registry.ci.openshift.org/knative/release-1.33.0:serverless-bundle \
registry.ci.openshift.org/knative/release-1.34.0:serverless-bundle \
registry.ci.openshift.org/knative/release-1.35.0:serverless-bundle >> /configs/index.yaml || \
/bin/opm render --skip-tls-verify -o yaml \
registry.ci.openshift.org/knative/release-1.33.0:serverless-bundle \
registry.ci.openshift.org/knative/release-1.34.0:serverless-bundle \
quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-135/serverless-bundle@sha256:0d5feb3c9f59246d16db1c687e3c1085fcc8a360cd51974197a878944df06b1d >> /configs/index.yaml
registry.ci.openshift.org/knative/release-1.35.0:serverless-bundle \
>> /configs/index.yaml
Copy link
Member Author

Choose a reason for hiding this comment

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

@mgencur this is the issue SERVERLESS_BUNDLE in dockerfile.sh is empty

Copy link
Member Author

Choose a reason for hiding this comment

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

++++ skopeo inspect --no-tags=true docker://quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-136/serverless-bundle:latest
++++ jq -r .Digest
FATA[0001] Error parsing image name "docker://quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-136/serverless-bundle:latest": reading manifest latest in quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-136/serverless-bundle: unauthorized: access to the requested resource is not authorized 
++++ echo ''
+++ digest=
+++ '[' '' = '' ']'
+++ '[' false = true ']'
+++ echo ''
+++ return
++ image=
++ [[ '' == '' ]]
+++ image_with_sha registry.ci.openshift.org/knative/serverless-bundle:release-1.36.0
+++ image=registry.ci.openshift.org/knative/serverless-bundle:release-1.36.0
+++ return_input_on_empty=false
++++ skopeo inspect --no-tags=true docker://registry.ci.openshift.org/knative/serverless-bundle:release-1.36.0
++++ jq -r .Digest
FATA[0000] Error parsing image name "docker://registry.ci.openshift.org/knative/serverless-bundle:release-1.36.0": reading manifest release-1.36.0 in registry.ci.openshift.org/knative/serverless-bundle: manifest unknown 

it can't find either
quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-136/serverless-bundle
registry.ci.openshift.org/knative/serverless-bundle:release-1.36.0

(expected)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm wondering if we need to also fallback to knative-main in get_bundle_for_version when not even CI registry.ci.openshift.org/knative/serverless-bundle:release-1.36.0 is available?

  # As a backup, try also CI registry.
  if [[ "${image}" == "" ]]; then
    image=$(image_with_sha "registry.ci.openshift.org/knative/serverless-bundle:release-${version}")
  fi
  if [[ "${image}" == "" ]]; then
    image=$(image_with_sha "registry.ci.openshift.org/knative/serverless-bundle:knative-main")
  fi

Copy link
Contributor

Choose a reason for hiding this comment

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

This will fix it for the Dockerfile: https://gist.github.com/mgencur/5316c4655abcb92e28a3455ee02a0b5f
But I'm still checking if the final catalog can be generated properly if the latest bundle doesn't exist yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

My solution can't build the catalog properly because it requires the image to exist:

INFO    16:41:10.114 Generating catalog for OCP 4.14
INFO[0000] rendering index "registry.redhat.io/redhat/redhat-operator-index:v4.14" as file-based catalog 
INFO[0404] wrote rendered file-based catalog to "/tmp/knative.JC1YvFt4/tmp.hVU6K2GqdC" 
FATA[0002] Error parsing image name "docker://quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-136/serverless-bundle:latest": reading manifest latest in quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-136/serverless-bundle: unauthorized: access to the requested resource is not authorized 
2024/11/27 16:49:45 render reference "quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-136/serverless-bundle:latest": error resolving name for image ref quay.io/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-136/serverless-bundle:latest: unexpected status from HEAD request to https://quay.io/v2/redhat-user-workloads/ocp-serverless-tenant/serverless-operator-136/serverless-bundle/manifests/latest: 401 UNAUTHORIZED
ERROR   16:49:45.652 🚨 Error (code: 1) occurred at ./hack/generate/catalog.sh:49, with command: opm alpha render-template basic --migrate-level="$level" "${catalog_template}" -oyaml > "${index_dir}/v${ocp_version}/catalog/serverless-operator/catalog.yaml"

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe if it doesn't, we can keep it that way for a few days until the new bundle is in there, the new bundle will be available as soon as we merge PRs like this one

Copy link
Contributor

Choose a reason for hiding this comment

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

So, yeah. We could fall back to registry.ci.openshift.org/knative/serverless-bundle:knative-main


# The base image is expected to contain
# /bin/opm (with a serve subcommand) and /bin/grpc_health_probe
Expand Down
18 changes: 9 additions & 9 deletions olm-catalog/serverless-operator-index/configs/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ schema: olm.channel
name: stable
package: serverless-operator
entries:
- name: "serverless-operator.v1.36.0"
replaces: "serverless-operator.v1.35.0"
skipRange: ">=1.35.0 <1.36.0"
- name: "serverless-operator.v1.35.0"
replaces: "serverless-operator.v1.34.0"
skipRange: ">=1.34.0 <1.35.0"
- name: "serverless-operator.v1.34.0"
replaces: "serverless-operator.v1.33.0"
skipRange: ">=1.33.0 <1.34.0"
- name: serverless-operator.v1.33.0
- name: serverless-operator.v1.34.0
---
schema: olm.channel
name: stable-1.35
name: stable-1.36
package: serverless-operator
entries:
- name: "serverless-operator.v1.36.0"
replaces: "serverless-operator.v1.35.0"
skipRange: ">=1.35.0 <1.36.0"
- name: "serverless-operator.v1.35.0"
replaces: "serverless-operator.v1.34.0"
skipRange: ">=1.34.0 <1.35.0"
- name: "serverless-operator.v1.34.0"
replaces: "serverless-operator.v1.33.0"
skipRange: ">=1.33.0 <1.34.0"
- name: serverless-operator.v1.33.0
- name: serverless-operator.v1.34.0
6 changes: 3 additions & 3 deletions olm-catalog/serverless-operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=serverless-operator
LABEL operators.operatorframework.io.bundle.channel.default.v1="stable"
LABEL operators.operatorframework.io.bundle.channels.v1="stable,stable-1.35"
LABEL operators.operatorframework.io.bundle.channels.v1="stable,stable-1.36"

LABEL \
com.redhat.component="openshift-serverless-1-serverless-operator-bundle-container" \
name="openshift-serverless-1/serverless-operator-bundle" \
version="1.35.0" \
version="1.36.0" \
summary="Red Hat OpenShift Serverless Bundle" \
maintainer="[email protected]" \
description="Red Hat OpenShift Serverless Bundle" \
Expand All @@ -29,6 +29,6 @@ LABEL \
com.redhat.delivery.backport=false \
distribution-scope="authoritative-source-only" \
url="https://catalog.redhat.com/software/container-stacks/detail/5ec53fcb110f56bd24f2ddc5" \
release="1.35.0" \
release="1.36.0" \
io.openshift.tags="bundle" \
vendor="Red Hat, Inc."
Loading
Loading