mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 07:10:41 -08:00
refactor: replace zap with slog (#6466)
Signed-off-by: knqyf263 <knqyf263@gmail.com> Co-authored-by: Nikita Pivkin <nikita.pivkin@smartforce.io> Co-authored-by: simar7 <1254783+simar7@users.noreply.github.com>
This commit is contained in:
@@ -22,14 +22,14 @@ func Install(ctx context.Context, dir, repo string, quiet bool, opt types.Regist
|
||||
return xerrors.Errorf("repository parse error: %w", err)
|
||||
}
|
||||
|
||||
log.Logger.Infof("Installing the module from %s...", repo)
|
||||
log.Info("Installing the module from the repository...", log.String("repo", repo))
|
||||
artifact, err := oci.NewArtifact(repo, quiet, opt)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("module initialize error: %w", err)
|
||||
}
|
||||
|
||||
dst := filepath.Join(dir, ref.Context().Name())
|
||||
log.Logger.Debugf("Installing the module to %s...", dst)
|
||||
log.Debug("Installing the module...", log.String("dst", dst))
|
||||
|
||||
if err = artifact.Download(ctx, dst, oci.DownloadOption{MediaType: mediaType}); err != nil {
|
||||
return xerrors.Errorf("module download error: %w", err)
|
||||
@@ -45,7 +45,7 @@ func Uninstall(_ context.Context, dir, repo string) error {
|
||||
return xerrors.Errorf("repository parse error: %w", err)
|
||||
}
|
||||
|
||||
log.Logger.Infof("Uninstalling %s ...", repo)
|
||||
log.Info("Uninstalling the module ...", log.String("module", repo))
|
||||
dst := filepath.Join(dir, ref.Context().Name())
|
||||
if err = os.RemoveAll(dst); err != nil {
|
||||
return xerrors.Errorf("remove error: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user