From b1c80cf0ab83abe8686568c18b8d91780baaea63 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Sun, 21 Mar 2021 22:52:40 -0700 Subject: [PATCH] caps: add cap for gha cache backend Signed-off-by: Tonis Tiigi --- cache/remotecache/gha/gha.go | 2 +- solver/pb/caps.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cache/remotecache/gha/gha.go b/cache/remotecache/gha/gha.go index 2e0cd4f7..fe7d0e29 100644 --- a/cache/remotecache/gha/gha.go +++ b/cache/remotecache/gha/gha.go @@ -331,7 +331,7 @@ func (r *readerAt) Size() int64 { } func oneOffProgress(ctx context.Context, id string) func(err error) error { - pw, _, _ := progress.FromContext(ctx) + pw, _, _ := progress.NewFromContext(ctx) now := time.Now() st := progress.Status{ Started: &now, diff --git a/solver/pb/caps.go b/solver/pb/caps.go index 78ee1ffc..0f7aaeee 100644 --- a/solver/pb/caps.go +++ b/solver/pb/caps.go @@ -62,6 +62,8 @@ const ( CapMetaIgnoreCache apicaps.CapID = "meta.ignorecache" CapMetaDescription apicaps.CapID = "meta.description" CapMetaExportCache apicaps.CapID = "meta.exportcache" + + CapRemoteCacheGHA apicaps.CapID = "cache.gha" ) func init() { @@ -339,4 +341,10 @@ func init() { Enabled: true, Status: apicaps.CapStatusExperimental, }) + + Caps.Init(apicaps.Cap{ + ID: CapRemoteCacheGHA, + Enabled: true, + Status: apicaps.CapStatusExperimental, + }) }