mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 23:26:39 -08:00
refactor: fix auth error handling (#7615)
Signed-off-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
@@ -59,11 +59,8 @@ func (u *Updater) Update() error {
|
||||
log.Info("Downloading the Java DB...")
|
||||
|
||||
// TODO: support remote options
|
||||
var a *oci.Artifact
|
||||
if a, err = oci.NewArtifact(u.repo.String(), u.quiet, u.registryOption); err != nil {
|
||||
return xerrors.Errorf("oci error: %w", err)
|
||||
}
|
||||
if err = a.Download(context.Background(), dbDir, oci.DownloadOption{MediaType: mediaType}); err != nil {
|
||||
art := oci.NewArtifact(u.repo.String(), u.quiet, u.registryOption)
|
||||
if err = art.Download(context.Background(), dbDir, oci.DownloadOption{MediaType: mediaType}); err != nil {
|
||||
return xerrors.Errorf("DB download error: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user