diff --git a/04_setup_ironic.sh b/04_setup_ironic.sh index dd0cec391..1d7ecfc86 100755 --- a/04_setup_ironic.sh +++ b/04_setup_ironic.sh @@ -13,7 +13,7 @@ source ocp_install_env.sh #export IRONIC_INSPECTOR_LOCAL_IMAGE=https://github.com/metal3-io/ironic-inspector-image #export IRONIC_RHCOS_DOWNLOADER_LOCAL_IMAGE=https://github.com/openshift-metal3/rhcos-downloader #export BAREMETAL_OPERATOR_LOCAL_IMAGE=192.168.111.1:5000/localimages/bmo:latest -rm -f assets/templates/99_local-registry.yaml $OPENSHIFT_INSTALL_PATH/data/data/bootstrap/baremetal/files/etc/containers/registries.conf +rm -f assets/templates/99_local-registry.yaml DOCKERFILE=$(mktemp "release-update--XXXXXXXXXX") echo "FROM $OPENSHIFT_RELEASE_IMAGE" > $DOCKERFILE for IMAGE_VAR in $(env | grep "_LOCAL_IMAGE=" | grep -o "^[^=]*") ; do @@ -38,8 +38,6 @@ for IMAGE_VAR in $(env | grep "_LOCAL_IMAGE=" | grep -o "^[^=]*") ; do fi # Update the bootstrap and master nodes to treat 192.168.111.1:5000 as insecure - mkdir -p $OPENSHIFT_INSTALL_PATH/data/data/bootstrap/baremetal/files/etc/containers - echo -e "[registries.insecure]\nregistries = ['192.168.111.1:5000']" > $OPENSHIFT_INSTALL_PATH/data/data/bootstrap/baremetal/files/etc/containers/registries.conf cp assets/templates/99_local-registry.yaml.optional assets/templates/99_local-registry.yaml IMAGE_NAME=$(echo ${IMAGE_VAR/_LOCAL_IMAGE} | tr '[:upper:]_' '[:lower:]-') @@ -48,7 +46,6 @@ for IMAGE_VAR in $(env | grep "_LOCAL_IMAGE=" | grep -o "^[^=]*") ; do done if [ -f assets/templates/99_local-registry.yaml ] ; then - build_installer sudo podman image build -t $OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE -f $DOCKERFILE sudo podman push --tls-verify=false $OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE $OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE fi diff --git a/common.sh b/common.sh index 8567cb3d6..ee0094ba5 100644 --- a/common.sh +++ b/common.sh @@ -39,11 +39,6 @@ source $CONFIG export OPENSHIFT_RELEASE_IMAGE="${OPENSHIFT_RELEASE_IMAGE:-registry.svc.ci.openshift.org/ocp/release:4.2}" export OPENSHIFT_INSTALL_PATH="$GOPATH/src/github.com/openshift/installer" -if env | grep -q "_LOCAL_IMAGE=" ; then - # We need a custome installer (allows http image pulls for local images) - KNI_INSTALL_FROM_GIT=true -fi - if [ -z "$KNI_INSTALL_FROM_GIT" ]; then export OPENSHIFT_INSTALLER=${OPENSHIFT_INSTALLER:-ocp/openshift-baremetal-install} else diff --git a/utils.sh b/utils.sh index 1d35e05ed..38ee448ef 100644 --- a/utils.sh +++ b/utils.sh @@ -47,6 +47,16 @@ function create_cluster() { custom_ntp bmo_config_map + # We're generating a config to allow the master nodes to download + # from our local container cache, put the same change on the bootstrap node + if [ -e ./assets/generated/99_local-registry.yaml ] ; then + cp ${assets_dir}/install-config.yaml{.tmp,} + $OPENSHIFT_INSTALLER --dir "${assets_dir}" --log-level=debug create ignition-configs + yq .spec.config.storage.files[0] ./assets/generated/99_local-registry.yaml | \ + jq -s '.[0]["storage"]["files"] = .[0]["storage"]["files"] + [.[1]] | .[0] ' ${assets_dir}/bootstrap.ign - > ./${assets_dir}/bootstrap.ign.tmp + mv ${assets_dir}/bootstrap.ign.tmp ${assets_dir}/bootstrap.ign + fi + mkdir -p ${assets_dir}/openshift cp -rf assets/generated/*.yaml ${assets_dir}/openshift