diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cae7c4..4672546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Unreleased +## 0.0.11 (2025-04-11) + ### Added - Multiple exports are now allowed if the build daemon is detected to have diff --git a/provider/internal/cache.go b/provider/internal/cache.go index 1c7b37b..5d0ab70 100644 --- a/provider/internal/cache.go +++ b/provider/internal/cache.go @@ -474,21 +474,21 @@ func (c CacheFrom) validate(preview bool) (*controllerapi.CacheOptionsEntry, err } pb := parsed[0].ToPB() - if !containsGithubToken(pb) { + if !isActive(pb) { pb = nil } return pb, nil } -// containsGithubToken checks if the GitHub token is set in the cache entry. +// isActive checks if the GitHub token is set in the cache entry. // If it is not a GHA cache entry, it will return true. // This is to maintain backwards compatibility with the old buildx behaviour. -func containsGithubToken(ci *controllerapi.CacheOptionsEntry) bool { +func isActive(ci *controllerapi.CacheOptionsEntry) bool { if ci.Type != "gha" { return true } - return ci.Attrs["token"] != "" && ci.Attrs["url"] != "" + return ci.Attrs["token"] != "" && (ci.Attrs["url"] != "" || ci.Attrs["url_v2"] != "") } // CacheToInline embeds cache information directly into an image. @@ -698,7 +698,7 @@ func (c CacheTo) validate(preview bool) (*controllerapi.CacheOptionsEntry, error } pb := parsed[0].ToPB() - if !containsGithubToken(pb) { + if !isActive(pb) { pb = nil }