Skip to content

Commit

Permalink
Add podman-remote binary to bundle
Browse files Browse the repository at this point in the history
The podman client exactly matches the podman version of the server.
It replicates what we do with oc.
  • Loading branch information
guillaumerose committed Mar 30, 2021
1 parent bafff21 commit f2eeb80
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ pull-secret
oc
yq
openshift-clients/
podman-remote/
26 changes: 26 additions & 0 deletions createdisk-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ function copy_additional_files {
# Copy oc client
cp openshift-clients/linux/oc $destDir/

cp podman-remote/linux/podman $destDir/

update_json_description $srcDir $destDir

eventually_add_pull_secret $destDir
Expand Down Expand Up @@ -220,6 +222,8 @@ function generate_hyperkit_bundle {
# Copy oc client
cp openshift-clients/mac/oc $destDir/

cp podman-remote/mac/podman $destDir/

# Update the bundle metadata info
cat $srcDir/crc-bundle-info.json \
| ${JQ} ".name = \"${destDir}\"" \
Expand All @@ -245,6 +249,8 @@ function generate_hyperv_bundle {
# Copy oc client
cp openshift-clients/windows/oc.exe $destDir/

cp podman-remote/windows/podman.exe $destDir/

${QEMU_IMG} convert -f qcow2 -O vhdx -o subformat=dynamic $srcDir/${CRC_VM_NAME}.qcow2 $destDir/${CRC_VM_NAME}.vhdx

diskSize=$(du -b $destDir/${CRC_VM_NAME}.vhdx | awk '{print $1}')
Expand All @@ -268,3 +274,23 @@ function create_tarball {

tar cSf - --sort=name "$dirName" | ${ZSTD} --no-progress ${CRC_ZSTD_EXTRA_FLAGS} --threads=0 -o "$dirName".crcbundle
}

function download_podman() {
local version=$1

mkdir -p podman-remote/linux
curl -L https://github.com/containers/podman/releases/download/v${version}/podman-remote-static.tar.gz | tar -zx -C podman-remote/linux podman-remote-static
mv podman-remote/linux/podman-remote-static podman-remote/linux/podman

if [ -n "${SNC_GENERATE_MACOS_BUNDLE}" ]; then
mkdir -p podman-remote/mac
curl -L https://github.com/containers/podman/releases/download/v${version}/podman-remote-release-darwin.zip > podman-remote/mac/podman.zip
${UNZIP} -o -d podman-remote/mac/ podman-remote/mac/podman.zip
fi

if [ -n "${SNC_GENERATE_WINDOWS_BUNDLE}" ]; then
mkdir -p podman-remote/windows
curl -L https://github.com/containers/podman/releases/download/v${version}/podman-remote-release-windows.zip > podman-remote/windows/podman.zip
${UNZIP} -o -d podman-remote/windows/ podman-remote/windows/podman.zip
fi
}
5 changes: 5 additions & 0 deletions createdisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ EOF
${SSH} core@api.${CRC_VM_NAME}.${BASE_DOMAIN} -- 'sudo rm -fr /etc/cni/net.d/100-crio-bridge.conf'
${SSH} core@api.${CRC_VM_NAME}.${BASE_DOMAIN} -- 'sudo rm -fr /etc/cni/net.d/200-loopback.conf'

podman_version=$(${SSH} core@api.${CRC_VM_NAME}.${BASE_DOMAIN} -- 'podman version -f json | jq -r .Client.Version')

# Remove the journal logs.
# Note: With `sudo journalctl --rotate --vacuum-time=1s`, it doesn't
# remove all the journal logs so separate commands are used here.
Expand All @@ -123,6 +125,9 @@ ${SSH} core@api.${CRC_VM_NAME}.${BASE_DOMAIN} -- 'sudo journalctl --vacuum-time=
# Shutdown the VM
shutdown_vm ${VM_PREFIX}

# Download podman clients
download_podman $podman_version

# libvirt image generation
get_dest_dir
destDirSuffix="${DEST_DIR}"
Expand Down

0 comments on commit f2eeb80

Please sign in to comment.