mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
e8543c720b
- Add SyncBlob method to sync service and on-demand interface - Integrate blob sync into GetBlob API handler - Use regclient to fetch blobs from upstream - Automatically trigger sync when blob not found locally - Handle sync errors gracefully with retry to local storage This implements the core requirement from PR #3733 discussion: check if blob exists, if not, sync from upstream on-demand. Co-authored-by: rchincha <45800463+rchincha@users.noreply.github.com>
26 lines
513 B
Go
26 lines
513 B
Go
//go:build !sync
|
|
|
|
package sync
|
|
|
|
import (
|
|
"context"
|
|
|
|
godigest "github.com/opencontainers/go-digest"
|
|
)
|
|
|
|
type BaseOnDemand struct{}
|
|
|
|
func (onDemand *BaseOnDemand) SyncImage(ctx context.Context, repo, reference string) error {
|
|
return nil
|
|
}
|
|
|
|
func (onDemand *BaseOnDemand) SyncReferrers(ctx context.Context, repo string,
|
|
subjectDigestStr string, referenceTypes []string,
|
|
) error {
|
|
return nil
|
|
}
|
|
|
|
func (onDemand *BaseOnDemand) SyncBlob(ctx context.Context, repo string, digest godigest.Digest) error {
|
|
return nil
|
|
}
|