diff --git a/04_setup_ironic.sh b/04_setup_ironic.sh index a865d3656469..3c028d0f38f6 100755 --- a/04_setup_ironic.sh +++ b/04_setup_ironic.sh @@ -17,10 +17,12 @@ PODMAN_VERSION=$(sudo podman version -f json | jq -r '.Version,.Client.Version|s # To replace an image entry in the openshift releae image, set # _LOCAL_IMAGE - where ENTRYNAME matches an uppercase version of the name in the release image -# with "-" converted to "_" e.g. to use a custom ironic-inspector -#export IRONIC_INSPECTOR_LOCAL_IMAGE=https://github.com/metal3-io/ironic-inspector-image +# with "-" converted to "_" e.g. to use a custom ironic image +#export IRONIC_LOCAL_IMAGE=https://github.com/metal3-io/ironic-image #export IRONIC_MACHINE_OS_DOWNLOADER_LOCAL_IMAGE=https://github.com/openshift-metal3/ironic-rhcos-downloader #export BAREMETAL_OPERATOR_LOCAL_IMAGE=192.168.111.1:5000/localimages/bmo:latest +# The use of IRONIC_INSPECTOR_LOCAL_IMAGE is limited to Openshift up to Version 4.8, +# starting from Openshift 4.9 the ironic-inspector container is not used anymore rm -f assets/templates/99_local-registry.yaml $OPENSHIFT_INSTALL_PATH/data/data/bootstrap/baremetal/files/etc/containers/registries.conf write_pull_secret diff --git a/common.sh b/common.sh index 12611134ef5b..9de3fc369c2b 100644 --- a/common.sh +++ b/common.sh @@ -30,6 +30,14 @@ function error () { echo $@ 1>&2 } +is_lower_version () { + if [[ $(echo "$1 $2" | tr " " "\n" | sort -V | head -n1) != $2 ]]; then + return 0 + else + return 1 + fi +} + # Get variables from the config file if [ -z "${CONFIG:-}" ]; then # See if there's a config_$USER.sh in the SCRIPTDIR @@ -160,7 +168,10 @@ export MIRROR_LOG_FILE=${REGISTRY_DIR}/${CLUSTER_NAME}-image_mirror-${OPENSHIFT_ # Switch Container Images to upstream, Installer defaults these to the openshift version if [ "${UPSTREAM_IRONIC:-false}" != "false" ] ; then export IRONIC_LOCAL_IMAGE=${IRONIC_LOCAL_IMAGE:-"quay.io/metal3-io/ironic:master"} - export IRONIC_INSPECTOR_LOCAL_IMAGE=${IRONIC_INSPECTOR_LOCAL_IMAGE:-"quay.io/metal3-io/ironic-inspector:master"} +# Starting from Openshift 4.9 the ironic-inspector container is not used anymore + if is_lower_version $OPENSHIFT_VERSION 4.9; then + export IRONIC_INSPECTOR_LOCAL_IMAGE=${IRONIC_INSPECTOR_LOCAL_IMAGE:-"quay.io/metal3-io/ironic-inspector:master"} + fi export IRONIC_IPA_DOWNLOADER_LOCAL_IMAGE=${IRONIC_IPA_DOWNLOADER_LOCAL_IMAGE:-"quay.io/metal3-io/ironic-ipa-downloader:master"} export IRONIC_STATIC_IP_MANAGER_LOCAL_IMAGE=${IRONIC_STATIC_IP_MANAGER_LOCAL_IMAGE:-"quay.io/metal3-io/static-ip-manager"} export BAREMETAL_OPERATOR_LOCAL_IMAGE=${BAREMETAL_OPERATOR_LOCAL_IMAGE:-"quay.io/metal3-io/baremetal-operator"} diff --git a/config_example.sh b/config_example.sh index 87aac9add940..b51142559426 100755 --- a/config_example.sh +++ b/config_example.sh @@ -21,15 +21,19 @@ set -x #export OPENSHIFT_RELEASE_TYPE=nightly # Use _LOCAL_IMAGE to build or use copy of container images locally e.g. -#export IRONIC_INSPECTOR_LOCAL_IMAGE=https://github.com/metal3-io/ironic-inspector +#export IRONIC_LOCAL_IMAGE=https://github.com/metal3-io/ironic #export IRONIC_LOCAL_IMAGE=quay.io/username/ironic #export MACHINE_CONFIG_OPERATOR_LOCAL_IMAGE=https://github.com/openshift/machine-config-operator # NOTE: If a checkout already exists in $HOME, it won't be re-created. # NOTE: You must set CUSTOM_REPO_FILE to build some OpenShift images, e.g. ironic ones. +# NOTE: The use of IRONIC_INSPECTOR_LOCAL_IMAGE is limited to Openshift up to +# Version 4.8, starting from Openshift 4.9 the ironic-inspector container is not used anymore. # Use _EXTRA_PACKAGES to set the path (relative to dev-scripts or # absolute) to a file with extra packages to install in the image, one per line. -# At the moment, this option is supported with ironic-image and ironic-inspector-image +# At the moment, this option is supported with ironic-image and +# ironic-inspector-image (NOTE: the ironic-inspector container has been +# removed in Openshift 4.9) # For example: # export IRONIC_EXTRA_PACKAGES=ironic-extra-pkgs.txt diff --git a/run_ci.sh b/run_ci.sh index 2eea95ee390c..4cc74060b8a0 100755 --- a/run_ci.sh +++ b/run_ci.sh @@ -104,7 +104,8 @@ if [ -d "/home/notstack/ironic-image" ] ; then export IRONIC_LOCAL_IMAGE=https://github.com/metal3-io/ironic-image export UPSTREAM_IRONIC=true fi -if [ -d "/home/notstack/ironic-inspector-image" ] ; then +# Starting from Openshift 4.9 the ironic-inspector container is not used anymore +if is_lower_version $OPENSHIFT_VERSION 4.9 && [ -d "/home/notstack/ironic-inspector-image" ] ; then export IRONIC_INSPECTOR_LOCAL_IMAGE=https://github.com/metal3-io/ironic-inspector-image export UPSTREAM_IRONIC=true fi