Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop status warning #298

Merged
merged 2 commits into from
Feb 2, 2024
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
5 changes: 3 additions & 2 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,8 +1018,9 @@ pub(crate) async fn install_to_disk(mut opts: InstallToDiskOpts) -> Result<()> {
.with_context(|| format!("Querying {}", &block_opts.device))?;
if opts.via_loopback {
if !opts.config_opts.generic_image {
eprintln!("Automatically enabling --generic-image when installing via loopback");
std::thread::sleep(std::time::Duration::from_secs(2));
crate::utils::medium_visibility_warning(
"Automatically enabling --generic-image when installing via loopback",
);
opts.config_opts.generic_image = true;
}
if !target_blockdev_meta.file_type().is_file() {
Expand Down
2 changes: 0 additions & 2 deletions lib/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,6 @@ pub(crate) async fn status(opts: super::cli::StatusOpts) -> Result<()> {
host
};

crate::utils::warning("note: The format of this API is not yet stable");

// If we're in JSON mode, then convert the ostree data into Rust-native
// structures that can be serialized.
// Filter to just the serializable status structures.
Expand Down
7 changes: 5 additions & 2 deletions lib/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,16 @@ pub(crate) fn sigpolicy_from_opts(
}
}

/// Output a warning message
pub(crate) fn warning(s: &str) {
/// Output a warning message that we want to be quite visible.
/// The process (thread) execution will be delayed for a short time.
pub(crate) fn medium_visibility_warning(s: &str) {
anstream::eprintln!(
"{}{s}{}",
anstyle::AnsiColor::Red.render_fg(),
anstyle::Reset.render()
);
// When warning, add a sleep to ensure it's seen
std::thread::sleep(std::time::Duration::from_secs(1));
}

/// Given a possibly tagged image like quay.io/foo/bar:latest and a digest 0ab32..., return
Expand Down
Loading