Skip to content

Commit

Permalink
Ensure ImageContentSourcePolicy
Browse files Browse the repository at this point in the history
Signed-off-by: Pierangelo Di Pilato <[email protected]>
  • Loading branch information
pierDipi committed Jan 17, 2025
1 parent d47ca80 commit 814fd37
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions hack/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ create_namespaces "${SYSTEM_NAMESPACES[@]}"
if [[ $INSTALL_CERTMANAGER == "true" ]]; then
install_certmanager
fi
ensure_content_source_policy
ensure_catalogsource_installed
ensure_serverless_installed
2 changes: 2 additions & 0 deletions hack/lib/catalogsource.bash
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ EOF
target_img=${img%-rhel*}
fi

echo "Processing line: ${line}, image ${img} -> target image: ${target_img}"

local mirror1="${registry_target}/${target_img}"
local mirror2="${registry_target_previous}/${target_img}"

Expand Down
2 changes: 1 addition & 1 deletion hack/lib/images.bash
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ function image_with_sha {
return_input_on_empty=${2:-"false"}

# shellcheck disable=SC2086
digest=$(skopeo inspect --retry-times=5 --no-tags=true ${SKOPEO_EXTRA_FLAGS} "docker://${image}" | jq -r '.Digest' || echo "")
digest=$(skopeo inspect --retry-times=10 --no-tags=true ${SKOPEO_EXTRA_FLAGS} "docker://${image}" | jq -r '.Digest' || echo "")
if [ "${digest}" = "" ]; then
if [ "${return_input_on_empty}" = "true" ]; then
echo "${image}"
Expand Down
5 changes: 5 additions & 0 deletions hack/lib/serverless.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env bash

function ensure_content_source_policy {
rootdir="$(dirname "$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")")"
oc apply -f "$rootdir/olm-catalog/serverless-operator-index/image_content_source_policy.yaml"
}

function ensure_serverless_installed {
logger.info 'Check if Serverless is installed'
if oc get knativeserving.operator.knative.dev knative-serving -n "${SERVING_NAMESPACE}" >/dev/null 2>&1 && \
Expand Down

0 comments on commit 814fd37

Please sign in to comment.