fix: retry flag (#111)

Co-authored-by: Gerald Pinder <gmpinder@gmail.com>
This commit is contained in:
Hikari 2024-03-01 15:30:19 -06:00 committed by GitHub
parent 0ba78fab32
commit 6d2a21160d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -44,10 +44,10 @@ pub struct BuildCommand {
#[builder(default)]
push: bool,
/// Allow `bluebuild` to retry pushing images if it fails.
/// Block `bluebuild` from retrying to push the image.
#[arg(short, long, default_value_t = true)]
#[builder(default)]
retry_push: bool,
no_retry_push: bool,
/// The number of times to retry pushing the image.
#[arg(long, default_value_t = 1)]
@ -387,8 +387,7 @@ impl BuildCommand {
build_strat.tag(&full_image, image_name, tag)?;
if self.push {
let retry = self.retry_push;
let retry_count = if retry { self.retry_count } else { 0 };
let retry_count = if !self.no_retry_push { self.retry_count } else { 0 };
debug!("Pushing all images");
// Push images with retries (1s delay between retries)