vendor: docker v20.10.3-0.20220826112928-d2590dc3cd4f (22.06 branch)
- moby:a60b458179...d2590dc3cd- swarmkit:6068d1894d...48dd89375dThe .Parent field for buildcache entries was deprecated, and replaced with a .Parents (plural) field. This patch updates the code accordingly. Unlike the change in buildx9c3be32bc9we continue to fall back to the old field (which will be set on older API versions). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -124,10 +124,16 @@ func (c *buildCacheContext) ID() string {
|
||||
}
|
||||
|
||||
func (c *buildCacheContext) Parent() string {
|
||||
if c.trunc {
|
||||
return stringid.TruncateID(c.v.Parent)
|
||||
var parent string
|
||||
if len(c.v.Parents) > 0 {
|
||||
parent = strings.Join(c.v.Parents, ", ")
|
||||
} else {
|
||||
parent = c.v.Parent //nolint:staticcheck // Ignore SA1019: Field was deprecated in API v1.42, but kept for backward compatibility
|
||||
}
|
||||
return c.v.Parent
|
||||
if c.trunc {
|
||||
return stringid.TruncateID(parent)
|
||||
}
|
||||
return parent
|
||||
}
|
||||
|
||||
func (c *buildCacheContext) CacheType() string {
|
||||
|
||||
Reference in New Issue
Block a user