From eb7b63f4101592cf51f7f8aee436b454e6f61b9e Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Tue, 12 May 2026 17:40:27 -0400 Subject: [PATCH] updates for print format messages Signed-off-by: Adam Martin --- cmd/hauler/cli/store/add.go | 2 +- cmd/hauler/cli/store/sync.go | 8 ++++---- pkg/archives/archiver.go | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/hauler/cli/store/add.go b/cmd/hauler/cli/store/add.go index 97ec6c9..6b82838 100644 --- a/cmd/hauler/cli/store/add.go +++ b/cmd/hauler/cli/store/add.go @@ -134,7 +134,7 @@ func storeImage(ctx context.Context, s *store.Layout, i v1.Image, platform strin // rename image name in store newRef, err := name.ParseReference(rewrite) if err != nil { - l.Errorf("unable to parse rewrite name: %w", err) + l.Errorf("unable to parse rewrite name: %v", err) } rewriteReference(ctx, s, r, newRef) } diff --git a/cmd/hauler/cli/store/sync.go b/cmd/hauler/cli/store/sync.go index 7e81967..264be69 100644 --- a/cmd/hauler/cli/store/sync.go +++ b/cmd/hauler/cli/store/sync.go @@ -261,7 +261,7 @@ func processContent(ctx context.Context, fi *os.File, o *flags.SyncOpts, s *stor if i.Tlog { tlog = i.Tlog } - l.Debugf("transparency log for verification [%b]", tlog) + l.Debugf("transparency log for verification [%t]", tlog) if err := cosign.VerifySignature(ctx, s, key, tlog, i.Name, rso, ro); err != nil { l.Errorf("signature verification failed for image [%s]... skipping...\n%v", i.Name, err) @@ -321,7 +321,7 @@ func processContent(ctx context.Context, fi *os.File, o *flags.SyncOpts, s *stor if i.Tlog { tlog = i.Tlog } - l.Debugf("transparency log for verification [%b]", tlog) + l.Debugf("transparency log for verification [%t]", tlog) if err := cosign.VerifyKeylessSignature(ctx, s, certIdentity, certIdentityRegexp, certOidcIssuer, certOidcIssuerRegexp, certGithubWorkflowRepository, tlog, i.Name, rso, ro); err != nil { l.Errorf("keyless signature verification failed for image [%s]... skipping...\n%v", i.Name, err) @@ -402,7 +402,7 @@ func processContent(ctx context.Context, fi *os.File, o *flags.SyncOpts, s *stor if i.Tlog { tlog = i.Tlog } - l.Debugf("transparency log for verification [%b]", tlog) + l.Debugf("transparency log for verification [%t]", tlog) if err := cosign.VerifySignature(ctx, s, key, tlog, i.Name, rso, ro); err != nil { l.Errorf("signature verification failed for image [%s]... skipping...\n%v", i.Name, err) @@ -462,7 +462,7 @@ func processContent(ctx context.Context, fi *os.File, o *flags.SyncOpts, s *stor if i.Tlog { tlog = i.Tlog } - l.Debugf("transparency log for verification [%b]", tlog) + l.Debugf("transparency log for verification [%t]", tlog) if err := cosign.VerifyKeylessSignature(ctx, s, certIdentity, certIdentityRegexp, certOidcIssuer, certOidcIssuerRegexp, certGithubWorkflowRepository, tlog, i.Name, rso, ro); err != nil { l.Errorf("keyless signature verification failed for image [%s]... skipping...\n%v", i.Name, err) diff --git a/pkg/archives/archiver.go b/pkg/archives/archiver.go index bedbd8f..d651149 100644 --- a/pkg/archives/archiver.go +++ b/pkg/archives/archiver.go @@ -45,13 +45,13 @@ func Archive(ctx context.Context, dir, outfile string, compression archives.Comp l.Debugf("removing existing output file: [%s]", outfile) if err := os.RemoveAll(outfile); err != nil { errMsg := fmt.Errorf("failed to remove existing output file [%s]: %w", outfile, err) - l.Debugf(errMsg.Error()) + l.Debugf("%s", errMsg.Error()) return errMsg } if !isExist(dir) { errMsg := fmt.Errorf("directory [%s] does not exist, cannot proceed with archival", dir) - l.Debugf(errMsg.Error()) + l.Debugf("%s", errMsg.Error()) return errMsg } @@ -66,7 +66,7 @@ func Archive(ctx context.Context, dir, outfile string, compression archives.Comp }) if err != nil { errMsg := fmt.Errorf("error mapping files from directory [%s]: %w", dir, err) - l.Debugf(errMsg.Error()) + l.Debugf("%s", errMsg.Error()) return errMsg } l.Debugf("successfully mapped files for directory [%s]", dir) @@ -76,7 +76,7 @@ func Archive(ctx context.Context, dir, outfile string, compression archives.Comp outf, err := os.Create(outfile) if err != nil { errMsg := fmt.Errorf("error creating output file [%s]: %w", outfile, err) - l.Debugf(errMsg.Error()) + l.Debugf("%s", errMsg.Error()) return errMsg } defer func() { @@ -96,7 +96,7 @@ func Archive(ctx context.Context, dir, outfile string, compression archives.Comp err = format.Archive(context.Background(), outf, files) if err != nil { errMsg := fmt.Errorf("error during archive creation for output file [%s]: %w", outfile, err) - l.Debugf(errMsg.Error()) + l.Debugf("%s", errMsg.Error()) return errMsg } l.Debugf("archive created successfully [%s]", outfile)