Skip to content

Commit

Permalink
Changes post ironic/inspector merge (#1263)
Browse files Browse the repository at this point in the history
  • Loading branch information
elfosardo authored Aug 3, 2021
1 parent bd49206 commit 6d98933
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
6 changes: 4 additions & 2 deletions 04_setup_ironic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
# <ENTRYNAME>_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
Expand Down
13 changes: 12 additions & 1 deletion common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"}
Expand Down
8 changes: 6 additions & 2 deletions config_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@ set -x
#export OPENSHIFT_RELEASE_TYPE=nightly

# Use <NAME>_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 <IMAGE_NAME>_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

Expand Down
3 changes: 2 additions & 1 deletion run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d98933

Please sign in to comment.