mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
Pass in index annotations from builds on multiple nodes
Fixes #2540 Signed-off-by: Eli Treuherz <et@arenko.group>
This commit is contained in:
@ -14,7 +14,6 @@ import (
|
||||
"github.com/containerd/containerd/remotes"
|
||||
"github.com/containerd/errdefs"
|
||||
"github.com/distribution/reference"
|
||||
"github.com/docker/buildx/util/buildflags"
|
||||
"github.com/moby/buildkit/exporter/containerimage/exptypes"
|
||||
"github.com/moby/buildkit/util/contentutil"
|
||||
"github.com/opencontainers/go-digest"
|
||||
@ -29,7 +28,7 @@ type Source struct {
|
||||
Ref reference.Named
|
||||
}
|
||||
|
||||
func (r *Resolver) Combine(ctx context.Context, srcs []*Source, ann []string, preferIndex bool) ([]byte, ocispec.Descriptor, error) {
|
||||
func (r *Resolver) Combine(ctx context.Context, srcs []*Source, ann map[exptypes.AnnotationKey]string, preferIndex bool) ([]byte, ocispec.Descriptor, error) {
|
||||
eg, ctx := errgroup.WithContext(ctx)
|
||||
|
||||
dts := make([][]byte, len(srcs))
|
||||
@ -152,11 +151,7 @@ func (r *Resolver) Combine(ctx context.Context, srcs []*Source, ann []string, pr
|
||||
// annotations are only allowed on OCI indexes
|
||||
indexAnnotation := make(map[string]string)
|
||||
if mt == ocispec.MediaTypeImageIndex {
|
||||
annotations, err := buildflags.ParseAnnotations(ann)
|
||||
if err != nil {
|
||||
return nil, ocispec.Descriptor{}, err
|
||||
}
|
||||
for k, v := range annotations {
|
||||
for k, v := range ann {
|
||||
switch k.Type {
|
||||
case exptypes.AnnotationIndex:
|
||||
indexAnnotation[k.Key] = v
|
||||
|
Reference in New Issue
Block a user