Skip to content

Commit 381eb2d

Browse files
committed
AGENT-1193: Custom openshift-install can be used by appliance
If the openshift-install binary was built from source, this change copies it to it in the appliance's asset directory. Placing it in the asset directory will signal to the appliance to use it instead of downloading it from the release. This allows us to test changes in the installer repo without having to wait for it to merge and appear in an offcial release image. Hard coding to version 4.19 in the directory structures used by the *agent_iso_no_registry functions has also be removed.
1 parent 437d865 commit 381eb2d

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

agent/03_agent_build_installer.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ source $SCRIPTDIR/logging.sh
88
source $SCRIPTDIR/common.sh
99
source $SCRIPTDIR/agent/common.sh
1010

11-
# Temporarily skip building the agent installer in case of OVE ISO
12-
if [[ "${AGENT_E2E_TEST_BOOT_MODE}" == "ISO_NO_REGISTRY" ]]; then
13-
exit 0
14-
fi
15-
1611
# Override build tags
1712
export OPENSHIFT_INSTALLER_BUILD_TAGS=" "
1813

agent/06_agent_create_cluster.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ source $SCRIPTDIR/agent/e2e/agent-tui/utils.sh
1717

1818
early_deploy_validation
1919

20+
# The OCP version used in agent-installer-utils/tools/iso_builder/hack/helper.sh.
21+
# https://github.com/openshift/agent-installer-utils/blob/6422958144e27dbbe31c7fe98b514d43c988bcfb/tools/iso_builder/hack/helper.sh#L90
22+
# It is slightly different than OPENSHIFT_VERSION.
23+
# dev-scripts may need to create the working directory for the appliance if a custom openshift-install
24+
# binary is built. The same version string is used to be consistent with what is passed to
25+
# build-ove-image.sh in agent-installer-utils.
26+
full_ocp_version=$(skopeo inspect --authfile $PULL_SECRET_FILE docker://$OPENSHIFT_RELEASE_IMAGE | jq -r '.Labels["io.openshift.release"]')
27+
2028
function create_pxe_files() {
2129
local asset_dir=${1}
2230
local openshift_install=${2}
@@ -87,6 +95,16 @@ function create_agent_iso_no_registry() {
8795
if [[ ! -d $OPENSHIFT_AGENT_INSTALER_UTILS_PATH ]]; then
8896
sync_repo_and_patch go/src/github.com/openshift/agent-installer-utils https://github.com/openshift/agent-installer-utils.git
8997
fi
98+
99+
# If the openshift-install binary was built from source, copy it to the appliance's
100+
# asset directory. This allows it to be used by the appliance to generate the
101+
# unconfigured-ignition instead of the appliance downloading the binary from
102+
# the release.
103+
if [ ! -z "$KNI_INSTALL_FROM_GIT" -a -f "${OCP_DIR}/openshift-install" ]; then
104+
mkdir -p "${OCP_DIR}/iso_builder/${full_ocp_version}/appliance/"
105+
cp "${OCP_DIR}/openshift-install" "${OCP_DIR}/iso_builder/${full_ocp_version}/appliance/"
106+
fi
107+
90108
# Create agent ISO without registry a.k.a. OVE ISO
91109
local asset_dir=${1}
92110
pushd .
@@ -104,8 +122,8 @@ function create_agent_iso_no_registry() {
104122
function cleanup_diskspace_agent_iso_noregistry() {
105123
local asset_dir=${1%/} # Remove trailing slash if present
106124

107-
# Iterate over all versioned directories matching 4.19.*
108-
for dir in "$asset_dir"/4.19.*; do
125+
# Iterate over all versioned directories matching ${full_ocp_version}*
126+
for dir in "$asset_dir"/${full_ocp_version}*; do
109127
[ -d "$dir" ] || continue
110128

111129
echo "Cleaning up directory: $dir"

0 commit comments

Comments
 (0)