Skip to content

Commit

Permalink
pubsys: raise messages to 'warn' if AMI exists or repo doesn't
Browse files Browse the repository at this point in the history
During development, if you make changes without committing, pubsys will
see that an AMI exists for your (-dirty) commit and not register a new
one.  Similarly, if you have a repo configured in Infra.toml and expect
to be updating it, but it doesn't exist, pubsys will create a new one.
You may not want to continue testing in these cases if you thought a new
AMI was going to be built, or an existing repo updated, with your recent
changes.  Raise these to 'warn' level so they're more obvious.
  • Loading branch information
tjkirch committed Aug 11, 2021
1 parent 13d5ff1 commit 0141d43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tools/pubsys/src/aws/ami/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::aws::{client::build_client, parse_arch, region_from_string};
use crate::Args;
use futures::future::{join, lazy, ready, FutureExt};
use futures::stream::{self, StreamExt};
use log::{error, info, trace};
use log::{error, info, trace, warn};
use pubsys_config::{AwsConfig, InfraConfig};
use register::{get_ami_id, register_image, RegisteredIds};
use rusoto_core::{Region, RusotoError};
Expand Down Expand Up @@ -149,7 +149,7 @@ async fn _run(args: &Args, ami_args: &AmiArgs) -> Result<HashMap<String, Image>>
})?;

let (ids_of_image, already_registered) = if let Some(found_id) = maybe_id {
info!(
warn!(
"Found '{}' already registered in {}: {}",
ami_args.name,
base_region.name(),
Expand Down
4 changes: 2 additions & 2 deletions tools/pubsys/src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub(crate) mod validate_repo;
use crate::{friendly_version, Args};
use chrono::{DateTime, Utc};
use lazy_static::lazy_static;
use log::{debug, info, trace};
use log::{debug, info, trace, warn};
use parse_datetime::parse_datetime;
use pubsys_config::{InfraConfig, RepoConfig, RepoExpirationPolicy, SigningKeyConfig};
use semver::Version;
Expand Down Expand Up @@ -460,7 +460,7 @@ pub(crate) fn run(args: &Args, repo_args: &RepoArgs) -> Result<()> {
match load_editor_and_manifest(&repo_args.root_role_path, &metadata_url, &targets_url)? {
Some((editor, manifest)) => (editor, manifest),
None => {
info!(
warn!(
"Did not find repo at '{}', starting a new one",
metadata_url
);
Expand Down

0 comments on commit 0141d43

Please sign in to comment.