Skip to content
Merged
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
4 changes: 3 additions & 1 deletion test/bin/build_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ extract_container_images() {
dnf_options="--repofrompath ${repo_name},${repo_spec} --repo ${repo_name}"
elif [[ "${repo_spec}" =~ ^/.* ]]; then
# If the spec is a path, set up the arguments to point to that path.
dnf_options="--repofrompath ${repo_name},${repo_spec} --repo ${repo_name}"
# Disabling dnf strict option and refreshing cache are required because the
# download command does not run elevated.
dnf_options="--repofrompath ${repo_name},${repo_spec} --repo ${repo_name} --setopt=strict=False --refresh"
elif [[ -n ${repo_spec} ]]; then
# If the spec is a name, assume it is already known to the
# system through normal configuration. The repo does not need
Expand Down
5 changes: 4 additions & 1 deletion test/bin/pyutils/build_bootc_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ def extract_container_images(version, repo_spec, outfile, dry_run=False):
dnf_options.extend(["--repofrompath", f"{repo_name},{repo_spec}", "--repo", repo_name])
elif re.match(r'^/.*', repo_spec):
# If the spec is a path, set up the arguments to point to that path.
dnf_options.extend(["--repofrompath", f"{repo_name},{repo_spec}", "--repo", repo_name])
# Disabling dnf strict option and refreshing cache are required because the
# download command does not run elevated.
dnf_options.extend(["--repofrompath", f"{repo_name},{repo_spec}", "--repo", repo_name,
"--setopt=strict=False", "--refresh"])
elif repo_spec:
# If the spec is a name, assume it is already known to the
# system through normal configuration. The repo does not need
Expand Down
9 changes: 9 additions & 0 deletions test/bin/scenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,15 @@ prepare_kickstart() {
exit 1
fi

# For bootc kickstart templates, make sure that commit references are
# fully qualified. Unqualified references are assumed to be served from
# the local mirror registry.
if [[ "${template}" == *bootc* ]] ; then
if [ "$(dirname "${boot_commit_ref}")" == "." ] ; then
boot_commit_ref="${MIRROR_REGISTRY_URL}/${boot_commit_ref}"
fi
fi

mkdir -p "${output_dir}"
for ifile in "${KICKSTART_TEMPLATE_DIR}/${template}" "${KICKSTART_TEMPLATE_DIR}"/includes/*.cfg ; do
local output_file
Expand Down
6 changes: 2 additions & 4 deletions test/kickstart-templates/includes/main-ostreecontainer.cfg
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Configure support of pulling images both from a local mirror and remote registries.
# Note: skopeo falls back to 'docker.io/library' prefix when specifying unqualified
# image names. These need to be redirected to the local mirror location.
# Configure support of pulling images both from a local mirror and remote registries
%pre-install --log=/dev/console --erroronfail

mkdir -p /etc/containers/registries.conf.d
# Enable insecure registry access from the hypervisor to allow local image pull.
# See https://github.com/containers/bootc/blob/main/docs/src/registries-and-offline.md#insecure-registries
cat > /etc/containers/registries.conf.d/998-microshift-bootc-registry.conf <<'EOF'
[[registry]]
prefix = "docker.io/library"
prefix = ""
location = "REPLACE_BOOTC_REGISTRY_URL"
insecure = true
EOF
Expand Down