From b02f479f224f697d32e5fef208237d9de8171594 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Tue, 22 Jun 2021 16:26:12 -0400 Subject: [PATCH] . --- go.mod | 2 +- go.sum | 2 ++ pkg/build/gobuild.go | 8 ++------ .../google/go-containerregistry/cmd/crane/cmd/mutate.go | 6 +----- .../google/go-containerregistry/pkg/v1/mutate/mutate.go | 6 ++---- vendor/modules.txt | 2 +- 6 files changed, 9 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 1431b85efe..a53ed9f9d4 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/fsnotify/fsnotify v1.4.9 github.com/go-training/helloworld v0.0.0-20200225145412-ba5f4379d78b github.com/google/go-cmp v0.5.6 - github.com/google/go-containerregistry v0.5.2-0.20210622175925-92e9e85a7f1c + github.com/google/go-containerregistry v0.5.2-0.20210622202051-acad0ede73ff github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc // indirect github.com/mattmoor/dep-notify v0.0.0-20190205035814-a45dec370a17 github.com/onsi/gomega v1.10.3 // indirect diff --git a/go.sum b/go.sum index 0ad81ec883..7fe91bb74f 100644 --- a/go.sum +++ b/go.sum @@ -421,6 +421,8 @@ github.com/google/go-containerregistry v0.5.0 h1:eb9sinv4PKm0AUwQGov0mvIdA4pyBGj github.com/google/go-containerregistry v0.5.0/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= github.com/google/go-containerregistry v0.5.2-0.20210622175925-92e9e85a7f1c h1:gYZwcIX3UVlYlXsu0wgFk6rFaWVuEE8O0YscFnGNPGQ= github.com/google/go-containerregistry v0.5.2-0.20210622175925-92e9e85a7f1c/go.mod h1:R5WRYyTdQqTchlBhX4q+WICGh8HQIL5wDFoFZv7Jq6Q= +github.com/google/go-containerregistry v0.5.2-0.20210622202051-acad0ede73ff h1:ofDPlq1NyfmbTPMTWQenAcA52tkqXTz7CKhQmWi9R9A= +github.com/google/go-containerregistry v0.5.2-0.20210622202051-acad0ede73ff/go.mod h1:R5WRYyTdQqTchlBhX4q+WICGh8HQIL5wDFoFZv7Jq6Q= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= diff --git a/pkg/build/gobuild.go b/pkg/build/gobuild.go index 4ef43b4cfd..54880f6e92 100644 --- a/pkg/build/gobuild.go +++ b/pkg/build/gobuild.go @@ -665,14 +665,10 @@ func (g *gobuild) buildOne(ctx context.Context, refStr string, baseRef name.Refe return nil, err } - m := map[string]string{ + withApp = mutate.Annotations(withApp, map[string]string{ baseRefAnnotation: baseRef.Name(), baseDigestAnnotation: baseDigest.String(), - } - withApp, err = mutate.Annotations(withApp, m) - if err != nil { - return nil, err - } + }) // Start from a copy of the base image's config file, and set // the entrypoint to our app. diff --git a/vendor/github.com/google/go-containerregistry/cmd/crane/cmd/mutate.go b/vendor/github.com/google/go-containerregistry/cmd/crane/cmd/mutate.go index 0664252f11..5eade783b4 100644 --- a/vendor/github.com/google/go-containerregistry/cmd/crane/cmd/mutate.go +++ b/vendor/github.com/google/go-containerregistry/cmd/crane/cmd/mutate.go @@ -91,11 +91,7 @@ func NewCmdMutate(options *[]crane.Option) *cobra.Command { log.Fatalf("mutating config: %v", err) } - // Mutate and write image. - img, err = mutate.Annotations(img, annotations) - if err != nil { - log.Fatalf("mutating annotations: %v", err) - } + img = mutate.Annotations(img, annotations) // If the new ref isn't provided, write over the original image. // If that ref was provided by digest (e.g., output from diff --git a/vendor/github.com/google/go-containerregistry/pkg/v1/mutate/mutate.go b/vendor/github.com/google/go-containerregistry/pkg/v1/mutate/mutate.go index 70df4e468e..be780fec4b 100644 --- a/vendor/github.com/google/go-containerregistry/pkg/v1/mutate/mutate.go +++ b/vendor/github.com/google/go-containerregistry/pkg/v1/mutate/mutate.go @@ -114,13 +114,11 @@ func Config(base v1.Image, cfg v1.Config) (v1.Image, error) { } // Annotations mutates the provided v1.Image to have the provided annotations -func Annotations(base v1.Image, annotations map[string]string) (v1.Image, error) { - image := &image{ +func Annotations(base v1.Image, annotations map[string]string) v1.Image { + return &image{ base: base, annotations: annotations, } - - return image, nil } // ConfigFile mutates the provided v1.Image to have the provided v1.ConfigFile diff --git a/vendor/modules.txt b/vendor/modules.txt index 514b784e61..157b6344d8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -108,7 +108,7 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/go-containerregistry v0.5.2-0.20210622175925-92e9e85a7f1c +# github.com/google/go-containerregistry v0.5.2-0.20210622202051-acad0ede73ff ## explicit github.com/google/go-containerregistry/cmd/crane/cmd github.com/google/go-containerregistry/internal/and