Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions 04_setup_ironic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:]-')
Expand All @@ -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
Expand Down
5 changes: 0 additions & 5 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 | \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is it specified that yq is a requirement to run dev-scripts?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's installed along with the other dependencies here:

https://github.com/metal3-io/metal3-dev-env/blob/master/vm-setup/roles/packages_installation/defaults/main.yml#L117

It'd be nice to remove that requirement since it's a pip install, there are other approaches we could use such as https://github.com/ashcrow/filetranspiler but for now yq works.

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

Expand Down