Skip to content

Commit

Permalink
Add Konflux client, event-sender plugin and must-gather images to CSV (
Browse files Browse the repository at this point in the history
…#2983)

* Add Konflux client build to CSV

* Add Konflux event-sender plugin build to CSV

* Add kn-client shas

* Add must-gather image

* Update event-sender plugin shas

* Run `make release-files` to upgrade to latest image SHAs

* Add kn-client-artifacts to related images section in CSV
  • Loading branch information
creydr authored Nov 11, 2024
1 parent 8bef216 commit 410b797
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 18 deletions.
19 changes: 10 additions & 9 deletions hack/generate/csv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ source "$(dirname "${BASH_SOURCE[0]}")/../lib/metadata.bash"
# shellcheck disable=SC1091,SC1090
source "$(dirname "${BASH_SOURCE[0]}")/../lib/images.bash"

# TODO migrate CLI images to Konflux
client_version="$(metadata.get dependencies.cli)"
kn_event="${ci_registry_host}/knative/release-${client_version#knative-v}:client-plugin-event"

rbac_proxy=$(metadata.get 'dependencies.kube_rbac_proxy')

default_serverless_operator_images
Expand All @@ -28,13 +24,17 @@ if [[ ${USE_RELEASE_NEXT:-} == "true" ]]; then
knative_backstage_plugins_images_release
knative_serving_images_release
knative_kn_plugin_func_images_release
knative_client_images_release
knative_kn_plugin_event_images_release
else
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_kn_plugin_func_images
default_knative_client_images
default_knative_kn_plugin_event_images
fi

declare -a operator_images
Expand Down Expand Up @@ -124,8 +124,8 @@ kafka_image "kafka-controller-post-install__post-install" "${KNATIVE_EVEN
kafka_image "knative-kafka-storage-version-migrator__migrate" "${KNATIVE_EVENTING_STORAGE_VERSION_MIGRATION}" # Use eventing core image

image 'KUBE_RBAC_PROXY' "${rbac_proxy}"
image 'KN_PLUGIN_EVENT_SENDER' "${kn_event}-sender"
image 'KN_CLIENT' "${ci_registry}/$(metadata.get dependencies.cli):knative-client-kn"
image 'KN_PLUGIN_EVENT_SENDER' "${KNATIVE_KN_PLUGIN_EVENT_SENDER}"
image 'KN_CLIENT' "${KNATIVE_KN_CLIENT}"

image "KN_PLUGIN_FUNC_UTIL" "${KNATIVE_KN_PLUGIN_FUNC_FUNC_UTIL}"
image "KN_PLUGIN_FUNC_TEKTON_S2I" "${KNATIVE_KN_PLUGIN_FUNC_TEKTON_S2I}"
Expand All @@ -138,7 +138,7 @@ declare -A yaml_keys
yaml_keys[spec.version]="$(metadata.get project.version)"
yaml_keys[metadata.name]="$(metadata.get project.name).v$(metadata.get project.version)"
yaml_keys['metadata.annotations[olm.skipRange]']="$(metadata.get olm.skipRange)"
yaml_keys['metadata.annotations[operators.openshift.io/must-gather-image]']="$(metadata.get dependencies.mustgather.image)"
yaml_keys['metadata.annotations[operators.openshift.io/must-gather-image]']="${SERVERLESS_MUST_GATHER}"
yaml_keys[spec.minKubeVersion]="$(metadata.get requirements.kube.minVersion)"
yaml_keys[spec.replaces]="$(metadata.get project.name).v$(metadata.get olm.replaces)"

Expand Down Expand Up @@ -221,7 +221,8 @@ for name in "${kafka_images[@]}"; do
add_downstream_operator_deployment_env "$target" "KAFKA_IMAGE_${name}" "${kafka_images_addresses[$name]}"
done

add_related_image "$target" "IMAGE_MUST_GATHER" "$(metadata.get dependencies.mustgather.image)"
add_related_image "$target" "IMAGE_MUST_GATHER" "${SERVERLESS_MUST_GATHER}"
add_related_image "$target" "IMAGE_KN_CLIENT_CLI_ARTIFACTS" "${KNATIVE_KN_CLIENT_CLI_ARTIFACTS}"

# Add Knative Kafka version to the downstream operator
add_downstream_operator_deployment_env "$target" "CURRENT_VERSION" "$(metadata.get project.version)"
Expand All @@ -239,7 +240,7 @@ add_upstream_operator_deployment_env "$target" "KNATIVE_EVENTING_VERSION" "${eve
add_upstream_operator_deployment_env "$target" "KNATIVE_EVENTING_KAFKA_BROKER_VERSION" "${ekb_version/knative-v/}" # Remove `knative-v` prefix if exists

# Override the image for the CLI artifact deployment
yq write --inplace "$target" "spec.install.spec.deployments(name==knative-openshift).spec.template.spec.initContainers(name==cli-artifacts).image" "${ci_registry}/$(metadata.get dependencies.cli):knative-client-cli-artifacts"
yq write --inplace "$target" "spec.install.spec.deployments(name==knative-openshift).spec.template.spec.initContainers(name==cli-artifacts).image" "${KNATIVE_KN_CLIENT_CLI_ARTIFACTS}"

for name in "${!yaml_keys[@]}"; do
echo "Value: ${name} -> ${yaml_keys[$name]}"
Expand Down
2 changes: 2 additions & 0 deletions hack/generate/images-rekt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ 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

envsubst < "$template" > "$target"
38 changes: 38 additions & 0 deletions hack/lib/images.bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function default_serverless_operator_images() {
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}")}

export SERVERLESS_BUNDLE=${SERVERLESS_BUNDLE:-$(get_bundle_for_version "${CURRENT_VERSION}")}
export DEFAULT_SERVERLESS_BUNDLE=${DEFAULT_SERVERLESS_BUNDLE:-$(get_bundle_for_version "${CURRENT_VERSION}")}
Expand Down Expand Up @@ -211,6 +212,43 @@ function knative_kn_plugin_func_images() {
export KNATIVE_KN_PLUGIN_FUNC_PYTHON_39=${KNATIVE_KN_PLUGIN_FUNC_UTIL:-"$(metadata.get dependencies.func.python-39)"}
}

function knative_kn_plugin_event_images_release() {
knative_kn_plugin_event_images "${USE_IMAGE_RELEASE_TAG}"
}

function default_knative_kn_plugin_event_images() {
knative_kn_plugin_event_images "$(metadata.get dependencies.cli)"
}

function knative_kn_plugin_event_images() {
local knative_kn_plugin_event tag app_version
tag=${1:?"Provide tag for kn-plugin-event images"}

app_version=$(get_app_version_from_tag "${tag}")
knative_kn_plugin_event="${registry_prefix_quay}${app_version}/kn-plugin-event"

export KNATIVE_KN_PLUGIN_EVENT_SENDER=${KNATIVE_KN_PLUGIN_EVENT_SENDER:-$(latest_registry_redhat_io_image_sha "${knative_kn_plugin_event}-sender:${tag}")}
}

function knative_client_images_release() {
knative_client_images "${USE_IMAGE_RELEASE_TAG}"
}

function default_knative_client_images() {
knative_client_images "$(metadata.get dependencies.cli)"
}

function knative_client_images() {
local knative_client tag app_version
tag=${1:?"Provide tag for kn-client images"}

app_version=$(get_app_version_from_tag "${tag}")
knative_client="${registry_prefix_quay}${app_version}/kn-client"

export KNATIVE_KN_CLIENT=${KNATIVE_KN_CLIENT:-$(latest_registry_redhat_io_image_sha "${knative_client}-kn:${tag}")}
export KNATIVE_KN_CLIENT_CLI_ARTIFACTS=${KNATIVE_KN_CLIENT_CLI_ARTIFACTS:-$(latest_registry_redhat_io_image_sha "${knative_client}-cli-artifacts:${tag}")}
}

function default_knative_ingress_images() {
local kourier_registry istio_registry knative_kourier knative_istio kourier_app_version istio_app_version

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ metadata:
repository: https://github.com/openshift-knative/serverless-operator
support: Red Hat
olm.skipRange: '>=1.34.0 <1.35.0'
operators.openshift.io/must-gather-image: quay.io/openshift-knative/must-gather
operators.openshift.io/must-gather-image: registry.redhat.io/openshift-serverless-1/serverless-must-gather-rhel8@sha256:73bd7baf5f1875f5f5c64509c7675f9476ba3bbcd0b032bdf91e51ff9ffb0e7b
labels:
operatorframework.io/arch.amd64: supported
operatorframework.io/arch.ppc64le: supported
Expand Down Expand Up @@ -935,9 +935,9 @@ spec:
- name: "IMAGE_KUBE_RBAC_PROXY"
value: "registry.redhat.io/openshift4/ose-kube-rbac-proxy-rhel9@sha256:42be2d5bb4d09f4fa31602f8521af07b0c1f27f47379d1529b769bc7bd61abc9"
- name: "IMAGE_KN_PLUGIN_EVENT_SENDER"
value: "registry.ci.openshift.org/knative/release-1.15:client-plugin-event-sender"
value: "registry.redhat.io/openshift-serverless-1/kn-plugin-event-sender-rhel8@sha256:f0db760171a95c618a5b1fc93ac05b05cd1e19d880fc321a353d454ae2679109"
- name: "IMAGE_KN_CLIENT"
value: "registry.ci.openshift.org/openshift/knative-v1.15:knative-client-kn"
value: "registry.redhat.io/openshift-serverless-1/kn-client-kn-rhel8@sha256:2e24f1085ed369597713dc6416e454d62add751c8c22a0531210e727f35b6502"
- name: "IMAGE_KN_PLUGIN_FUNC_UTIL"
value: "registry.redhat.io/openshift-serverless-1/kn-plugin-func-func-util-rhel8@sha256:da3263b8d1961358ef384d35f152eb43260052bc0788f5f85cb101a492934117"
- name: "IMAGE_KN_PLUGIN_FUNC_TEKTON_S2I"
Expand Down Expand Up @@ -981,7 +981,7 @@ spec:
serviceAccountName: knative-openshift
initContainers:
- name: cli-artifacts
image: registry.ci.openshift.org/openshift/knative-v1.15:knative-client-cli-artifacts
image: registry.redhat.io/openshift-serverless-1/kn-client-cli-artifacts-rhel8@sha256:82a41eaae2cd8b6004dcb663a2cd359c09fecf646bf5beaec330463abea0ea90
imagePullPolicy: Always
command: ["sh", "-c", "rm -rf /cli-artifacts/* && cp /usr/share/kn/**/* /cli-artifacts && chmod 444 /cli-artifacts/*"]
volumeMounts:
Expand Down Expand Up @@ -1109,9 +1109,9 @@ spec:
- name: "IMAGE_KUBE_RBAC_PROXY"
value: "registry.redhat.io/openshift4/ose-kube-rbac-proxy-rhel9@sha256:42be2d5bb4d09f4fa31602f8521af07b0c1f27f47379d1529b769bc7bd61abc9"
- name: "IMAGE_KN_PLUGIN_EVENT_SENDER"
value: "registry.ci.openshift.org/knative/release-1.15:client-plugin-event-sender"
value: "registry.redhat.io/openshift-serverless-1/kn-plugin-event-sender-rhel8@sha256:f0db760171a95c618a5b1fc93ac05b05cd1e19d880fc321a353d454ae2679109"
- name: "IMAGE_KN_CLIENT"
value: "registry.ci.openshift.org/openshift/knative-v1.15:knative-client-kn"
value: "registry.redhat.io/openshift-serverless-1/kn-client-kn-rhel8@sha256:2e24f1085ed369597713dc6416e454d62add751c8c22a0531210e727f35b6502"
- name: "IMAGE_KN_PLUGIN_FUNC_UTIL"
value: "registry.redhat.io/openshift-serverless-1/kn-plugin-func-func-util-rhel8@sha256:da3263b8d1961358ef384d35f152eb43260052bc0788f5f85cb101a492934117"
- name: "IMAGE_KN_PLUGIN_FUNC_TEKTON_S2I"
Expand Down Expand Up @@ -1384,9 +1384,9 @@ spec:
- name: "IMAGE_KUBE_RBAC_PROXY"
image: "registry.redhat.io/openshift4/ose-kube-rbac-proxy-rhel9@sha256:42be2d5bb4d09f4fa31602f8521af07b0c1f27f47379d1529b769bc7bd61abc9"
- name: "IMAGE_KN_PLUGIN_EVENT_SENDER"
image: "registry.ci.openshift.org/knative/release-1.15:client-plugin-event-sender"
image: "registry.redhat.io/openshift-serverless-1/kn-plugin-event-sender-rhel8@sha256:f0db760171a95c618a5b1fc93ac05b05cd1e19d880fc321a353d454ae2679109"
- name: "IMAGE_KN_CLIENT"
image: "registry.ci.openshift.org/openshift/knative-v1.15:knative-client-kn"
image: "registry.redhat.io/openshift-serverless-1/kn-client-kn-rhel8@sha256:2e24f1085ed369597713dc6416e454d62add751c8c22a0531210e727f35b6502"
- name: "IMAGE_KN_PLUGIN_FUNC_UTIL"
image: "registry.redhat.io/openshift-serverless-1/kn-plugin-func-func-util-rhel8@sha256:da3263b8d1961358ef384d35f152eb43260052bc0788f5f85cb101a492934117"
- name: "IMAGE_KN_PLUGIN_FUNC_TEKTON_S2I"
Expand Down Expand Up @@ -1420,6 +1420,8 @@ spec:
- name: "KAFKA_IMAGE_knative-kafka-storage-version-migrator__migrate"
image: "registry.redhat.io/openshift-serverless-1/kn-eventing-migrate-rhel8@sha256:16628700b0b4ac8a079cc46750aefd829dc278e538a9f0d41473392f3896eaf2"
- name: "IMAGE_MUST_GATHER"
image: "quay.io/openshift-knative/must-gather"
image: "registry.redhat.io/openshift-serverless-1/serverless-must-gather-rhel8@sha256:73bd7baf5f1875f5f5c64509c7675f9476ba3bbcd0b032bdf91e51ff9ffb0e7b"
- name: "IMAGE_KN_CLIENT_CLI_ARTIFACTS"
image: "registry.redhat.io/openshift-serverless-1/kn-client-cli-artifacts-rhel8@sha256:82a41eaae2cd8b6004dcb663a2cd359c09fecf646bf5beaec330463abea0ea90"
replaces: serverless-operator.v1.34.0
version: 1.35.0

0 comments on commit 410b797

Please sign in to comment.