diff --git a/cache/remotecache/local/local.go b/cache/remotecache/local/local.go index 4c06d717b..9bff2cc79 100644 --- a/cache/remotecache/local/local.go +++ b/cache/remotecache/local/local.go @@ -23,6 +23,14 @@ const ( contentStoreIDPrefix = "local:" ) +type exporter struct { + remotecache.Exporter +} + +func (*exporter) Name() string { + return "exporting cache to client directory" +} + // ResolveCacheExporterFunc for "local" cache exporter. func ResolveCacheExporterFunc(sm *session.Manager) remotecache.ResolveCacheExporterFunc { return func(ctx context.Context, g session.Group, attrs map[string]string) (remotecache.Exporter, error) { @@ -47,7 +55,7 @@ func ResolveCacheExporterFunc(sm *session.Manager) remotecache.ResolveCacheExpor if err != nil { return nil, err } - return remotecache.NewExporter(cs, "", ociMediatypes, compressionConfig), nil + return &exporter{remotecache.NewExporter(cs, "", ociMediatypes, compressionConfig)}, nil } } diff --git a/cache/remotecache/registry/registry.go b/cache/remotecache/registry/registry.go index f282defc9..e82638ebf 100644 --- a/cache/remotecache/registry/registry.go +++ b/cache/remotecache/registry/registry.go @@ -40,6 +40,14 @@ const ( attrInsecure = "registry.insecure" ) +type exporter struct { + remotecache.Exporter +} + +func (*exporter) Name() string { + return "exporting cache to registry" +} + func ResolveCacheExporterFunc(sm *session.Manager, hosts docker.RegistryHosts) remotecache.ResolveCacheExporterFunc { return func(ctx context.Context, g session.Group, attrs map[string]string) (remotecache.Exporter, error) { compressionConfig, err := compression.ParseAttributes(attrs) @@ -74,7 +82,7 @@ func ResolveCacheExporterFunc(sm *session.Manager, hosts docker.RegistryHosts) r if err != nil { return nil, err } - return remotecache.NewExporter(contentutil.FromPusher(pusher), refString, ociMediatypes, compressionConfig), nil + return &exporter{remotecache.NewExporter(contentutil.FromPusher(pusher), refString, ociMediatypes, compressionConfig)}, nil } }