Skip to content

Commit 7ebbd65

Browse files
committed
refactor: fix stumbly code structure
1 parent ce5624d commit 7ebbd65

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

client/pull.go

+9-8
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,17 @@ func (c *Client) ConcurrentDownloadImage(ctx context.Context, dst *os.File, arch
158158
}
159159

160160
// Check for direct OCI registry access
161-
if err := c.ociDownloadImage(ctx, arch, name, tag, dst, spec, pb); err == nil {
162-
return err
163-
} else if !errors.Is(err, errOCIDownloadNotSupported) {
164-
// Return OCI download error or fallback to legacy download
165-
return err
166-
}
161+
if err := c.ociDownloadImage(ctx, arch, name, tag, dst, spec, pb); err != nil {
162+
if !errors.Is(err, errOCIDownloadNotSupported) {
163+
// Return OCI download error or fallback to legacy download
164+
return err
165+
}
167166

168-
c.Logger.Log("Fallback to (legacy) library download")
167+
c.Logger.Log("Fallback to (legacy) library download")
169168

170-
return c.legacyDownloadImage(ctx, arch, name, tag, dst, spec, pb)
169+
return c.legacyDownloadImage(ctx, arch, name, tag, dst, spec, pb)
170+
}
171+
return nil
171172
}
172173

173174
func (c *Client) legacyDownloadImage(ctx context.Context, arch, name, tag string, dst io.WriterAt, spec *Downloader, pb ProgressBar) error {

0 commit comments

Comments
 (0)