Skip to content

Commit b1e9e12

Browse files
committed
install: Deprecate skip-fetch-check, replace with run-fetch-check
This deprecates skip-fetch-check in favor of the inverse, run-fetch-check. Updates docs and tests to reflect the change. Signed-off-by: ckyrouac <ckyrouac@redhat.com>
1 parent 2de8e0d commit b1e9e12

File tree

8 files changed

+54
-49
lines changed

8 files changed

+54
-49
lines changed

docs/src/bootc-install.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,9 @@ installation in a manufacturing environment from a mirrored registry.
9393
By default, the installation process will verify that the container (representing the target OS)
9494
can fetch its own updates.
9595

96-
Additionally note that to perform an install with a target image reference set to an
96+
Additionally note that to perform an upgrade with a target image reference set to an
9797
authenticated registry, you must provide a pull secret. One path is to embed the pull secret into
9898
the image in `/etc/ostree/auth.json`.
99-
Alternatively, the secret can be added after an installation process completes and managed separately;
100-
in that case you will need to specify `--skip-fetch-check`.
10199

102100
### Configuring the default root filesystem type
103101

docs/src/man/bootc-install-to-disk.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ bootc-install-to-disk - Install to the target block device
77
**bootc install to-disk** \[**\--wipe**\] \[**\--block-setup**\]
88
\[**\--filesystem**\] \[**\--root-size**\] \[**\--source-imgref**\]
99
\[**\--target-transport**\] \[**\--target-imgref**\]
10-
\[**\--enforce-container-sigpolicy**\] \[**\--skip-fetch-check**\]
10+
\[**\--enforce-container-sigpolicy**\]
11+
\[**\--skip-fetch-check**\] \[**\--run-fetch-check**\]
1112
\[**\--disable-selinux**\] \[**\--karg**\]
1213
\[**\--root-ssh-authorized-keys**\] \[**\--generic-image**\]
1314
\[**\--bound-images**\] \[**\--stateroot**\] \[**\--via-loopback**\]
@@ -83,17 +84,16 @@ more complex such as RAID, LVM, LUKS etc.
8384
Enabling this option enforces that \`/etc/containers/policy.json\`
8485
includes a default policy which requires signatures
8586

86-
**\--skip-fetch-check**
87+
**\--skip-fetch-check (deprecated, see --run-fetch-check)**
8788

88-
: By default, the accessiblity of the target image will be verified
89-
(just the manifest will be fetched). Specifying this option
90-
suppresses the check; use this when you know the issues it might
91-
find are addressed.
89+
: This is now the default and has no effect.
9290

93-
A common reason this may fail is when one is using an image which
94-
requires registry authentication, but not embedding the pull secret
95-
in the image so that updates can be fetched by the installed OS
96-
\"day 2\".
91+
**\--run-fetch-check **
92+
93+
: Verify the target image can be pulled using the bootc image.
94+
95+
This will ensure the bootc system can be upgraded,
96+
i.e. the registry credentials are available on the bootc image.
9797

9898
**\--disable-selinux**
9999

docs/src/man/bootc-install-to-existing-root.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ bootc-install-to-existing-root - Install to the host root filesystem
77
**bootc install to-existing-root** \[**\--replace**\]
88
\[**\--source-imgref**\] \[**\--target-transport**\]
99
\[**\--target-imgref**\] \[**\--enforce-container-sigpolicy**\]
10-
\[**\--skip-fetch-check**\] \[**\--disable-selinux**\] \[**\--karg**\]
10+
\[**\--skip-fetch-check**\] \[**\--run-fetch-check**\]
1111
\[**\--root-ssh-authorized-keys**\] \[**\--generic-image**\]
1212
\[**\--bound-images**\] \[**\--stateroot**\]
1313
\[**\--acknowledge-destructive**\] \[**-h**\|**\--help**\]
@@ -68,17 +68,16 @@ cleaned up if desired when rebooted into the new root.
6868
Enabling this option enforces that \`/etc/containers/policy.json\`
6969
includes a default policy which requires signatures
7070

71-
**\--skip-fetch-check**
71+
**\--skip-fetch-check (deprecated, see --run-fetch-check)**
7272

73-
: By default, the accessiblity of the target image will be verified
74-
(just the manifest will be fetched). Specifying this option
75-
suppresses the check; use this when you know the issues it might
76-
find are addressed.
73+
: This is now the default and has no effect.
7774

78-
A common reason this may fail is when one is using an image which
79-
requires registry authentication, but not embedding the pull secret
80-
in the image so that updates can be fetched by the installed OS
81-
\"day 2\".
75+
**\--run-fetch-check**
76+
77+
: Verify the target image can be pulled using the bootc image.
78+
79+
This will ensure the bootc system can be upgraded,
80+
i.e. the registry credentials are available on the bootc image.
8281

8382
**\--disable-selinux**
8483

docs/src/man/bootc-install-to-filesystem.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ filesystem structure
1010
\[**\--acknowledge-destructive**\] \[**\--skip-finalize**\]
1111
\[**\--source-imgref**\] \[**\--target-transport**\]
1212
\[**\--target-imgref**\] \[**\--enforce-container-sigpolicy**\]
13-
\[**\--skip-fetch-check**\] \[**\--disable-selinux**\] \[**\--karg**\]
13+
\[**\--skip-fetch-check**\] \[**\--run-fetch-check**\]
14+
\[**\--disable-selinux**\] \[**\--karg**\]
1415
\[**\--root-ssh-authorized-keys**\] \[**\--generic-image**\]
1516
\[**\--bound-images**\] \[**\--stateroot**\] \[**-h**\|**\--help**\]
1617
\<*ROOT_PATH*\>
@@ -97,17 +98,16 @@ is currently expected to be empty by default.
9798
Enabling this option enforces that \`/etc/containers/policy.json\`
9899
includes a default policy which requires signatures
99100

100-
**\--skip-fetch-check**
101+
**\--skip-fetch-check (deprecated, see --run-fetch-check)**
101102

102-
: By default, the accessiblity of the target image will be verified
103-
(just the manifest will be fetched). Specifying this option
104-
suppresses the check; use this when you know the issues it might
105-
find are addressed.
103+
: This is now the default and has no effect.
106104

107-
A common reason this may fail is when one is using an image which
108-
requires registry authentication, but not embedding the pull secret
109-
in the image so that updates can be fetched by the installed OS
110-
\"day 2\".
105+
**\--run-fetch-check**
106+
107+
: Verify the target image can be pulled using the bootc image.
108+
109+
This will ensure the bootc system can be upgraded,
110+
i.e. the registry credentials are available on the bootc image.
111111

112112
**\--disable-selinux**
113113

hack/lldb/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sudo podman build --build-arg "sshpubkey=$(cat ~/.ssh/id_rsa.pub)" -f Containerf
1111
mkdir -p ~/.cache/bootc-dev/disks
1212
rm -f ~/.cache/bootc-dev/disks/lldb.raw
1313
truncate -s 10G ~/.cache/bootc-dev/disks/lldb.raw
14-
sudo podman run --pid=host --network=host --privileged --security-opt label=type:unconfined_t -v ~/.cache/bootc-dev/disks:/output localhost/bootc-lldb bootc install to-disk --via-loopback --generic-image --skip-fetch-check /output/lldb.raw
14+
sudo podman run --pid=host --network=host --privileged --security-opt label=type:unconfined_t -v ~/.cache/bootc-dev/disks:/output localhost/bootc-lldb bootc install to-disk --via-loopback --generic-image /output/lldb.raw
1515

1616
# create a new VM in libvirt
1717
set +e

lib/src/install.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,14 @@ pub(crate) struct InstallTargetOpts {
124124
#[serde(default)]
125125
pub(crate) enforce_container_sigpolicy: bool,
126126

127-
/// By default, the accessiblity of the target image will be verified (just the manifest will be fetched).
128-
/// Specifying this option suppresses the check; use this when you know the issues it might find
129-
/// are addressed.
130-
///
131-
/// A common reason this may fail is when one is using an image which requires registry authentication,
132-
/// but not embedding the pull secret in the image so that updates can be fetched by the installed OS "day 2".
127+
/// Verify the image can be fetched from the bootc image. Updates may fail when the installation
128+
/// host is authenticated with the registry but the pull secret is not in the bootc image.
129+
#[clap(long)]
130+
#[serde(default)]
131+
pub(crate) run_fetch_check: bool,
132+
133+
/// Verify the image can be fetched from the bootc image. Updates may fail when the installation
134+
/// host is authenticated with the registry but the pull secret is not in the bootc image.
133135
#[clap(long)]
134136
#[serde(default)]
135137
pub(crate) skip_fetch_check: bool,
@@ -1287,10 +1289,14 @@ async fn prepare_install(
12871289
// And continue to init global state
12881290
osbuild::adjust_for_bootc_image_builder(&rootfs, &tempdir)?;
12891291

1290-
if !target_opts.skip_fetch_check {
1292+
if target_opts.run_fetch_check {
12911293
verify_target_fetch(&tempdir, &target_imgref).await?;
12921294
}
12931295

1296+
if target_opts.skip_fetch_check {
1297+
tracing::warn!("--skip-fetch-check is deprecated and will be removed in a future version");
1298+
}
1299+
12941300
// Even though we require running in a container, the mounts we create should be specific
12951301
// to this process, so let's enter a private mountns to avoid leaking them.
12961302
if !external_source && std::env::var_os("BOOTC_SKIP_UNSHARE").is_none() {

tests-integration/src/hostpriv.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ fn test_loopback_install(image: &'static str) -> Result<()> {
2323
tmpdisk.as_file_mut().set_len(size)?;
2424
let tmpdisk = tmpdisk.into_temp_path();
2525
let tmpdisk = tmpdisk.to_str().unwrap();
26-
cmd!(sh, "sudo {base_args...} -v {tmpdisk}:/disk {image} bootc install to-disk --via-loopback --skip-fetch-check /disk").run()?;
26+
cmd!(
27+
sh,
28+
"sudo {base_args...} -v {tmpdisk}:/disk {image} bootc install to-disk --via-loopback /disk"
29+
)
30+
.run()?;
2731
Ok(())
2832
}
2933

tests-integration/src/install.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ pub(crate) fn run_alongside(image: &str, mut testargs: libtest_mimic::Arguments)
7676
// Handy defaults
7777

7878
let target_args = &["-v", "/:/target"];
79-
// We always need this as we assume we're operating on a local image
80-
let generic_inst_args = ["--skip-fetch-check"];
8179

8280
let tests = [
8381
Trial::test("loopback install", move || {
@@ -88,7 +86,7 @@ pub(crate) fn run_alongside(image: &str, mut testargs: libtest_mimic::Arguments)
8886
tmpdisk.as_file_mut().set_len(size)?;
8987
let tmpdisk = tmpdisk.into_temp_path();
9088
let tmpdisk = tmpdisk.to_str().unwrap();
91-
cmd!(sh, "sudo {BASE_ARGS...} -v {tmpdisk}:/disk {image} bootc install to-disk --via-loopback {generic_inst_args...} /disk").run()?;
89+
cmd!(sh, "sudo {BASE_ARGS...} -v {tmpdisk}:/disk {image} bootc install to-disk --via-loopback /disk").run()?;
9290
Ok(())
9391
}),
9492
Trial::test(
@@ -100,7 +98,7 @@ pub(crate) fn run_alongside(image: &str, mut testargs: libtest_mimic::Arguments)
10098
let tmp_keys = tmpd.path().join("test_authorized_keys");
10199
let tmp_keys = tmp_keys.to_str().unwrap();
102100
std::fs::write(&tmp_keys, b"ssh-ed25519 ABC0123 testcase@example.com")?;
103-
cmd!(sh, "sudo {BASE_ARGS...} {target_args...} -v {tmp_keys}:/test_authorized_keys {image} bootc install to-filesystem {generic_inst_args...} --acknowledge-destructive --karg=foo=bar --replace=alongside --root-ssh-authorized-keys=/test_authorized_keys /target").run()?;
101+
cmd!(sh, "sudo {BASE_ARGS...} {target_args...} -v {tmp_keys}:/test_authorized_keys {image} bootc install to-filesystem --acknowledge-destructive --karg=foo=bar --replace=alongside --root-ssh-authorized-keys=/test_authorized_keys /target").run()?;
104102

105103
// Also test install finalize here
106104
cmd!(
@@ -142,7 +140,7 @@ pub(crate) fn run_alongside(image: &str, mut testargs: libtest_mimic::Arguments)
142140
Trial::test("Install and verify selinux state", move || {
143141
let sh = &xshell::Shell::new()?;
144142
reset_root(sh, image)?;
145-
cmd!(sh, "sudo {BASE_ARGS...} {image} bootc install to-existing-root --acknowledge-destructive {generic_inst_args...}").run()?;
143+
cmd!(sh, "sudo {BASE_ARGS...} {image} bootc install to-existing-root --acknowledge-destructive").run()?;
146144
generic_post_install_verification()?;
147145
let root = &Dir::open_ambient_dir("/ostree", cap_std::ambient_authority()).unwrap();
148146
crate::selinux::verify_selinux_recurse(root, false)?;
@@ -151,7 +149,7 @@ pub(crate) fn run_alongside(image: &str, mut testargs: libtest_mimic::Arguments)
151149
Trial::test("Install to non-default stateroot", move || {
152150
let sh = &xshell::Shell::new()?;
153151
reset_root(sh, image)?;
154-
cmd!(sh, "sudo {BASE_ARGS...} {image} bootc install to-existing-root --stateroot {NON_DEFAULT_STATEROOT} --acknowledge-destructive {generic_inst_args...}").run()?;
152+
cmd!(sh, "sudo {BASE_ARGS...} {image} bootc install to-existing-root --stateroot {NON_DEFAULT_STATEROOT} --acknowledge-destructive").run()?;
155153
generic_post_install_verification()?;
156154
assert!(
157155
Utf8Path::new(&format!("/ostree/deploy/{NON_DEFAULT_STATEROOT}")).try_exists()?
@@ -163,7 +161,7 @@ pub(crate) fn run_alongside(image: &str, mut testargs: libtest_mimic::Arguments)
163161
reset_root(sh, image)?;
164162
let empty = sh.create_temp_dir()?;
165163
let empty = empty.path().to_str().unwrap();
166-
cmd!(sh, "sudo {BASE_ARGS...} -v {empty}:/usr/lib/bootc/install {image} bootc install to-existing-root {generic_inst_args...}").run()?;
164+
cmd!(sh, "sudo {BASE_ARGS...} -v {empty}:/usr/lib/bootc/install {image} bootc install to-existing-root").run()?;
167165
generic_post_install_verification()?;
168166
Ok(())
169167
}),

0 commit comments

Comments
 (0)