From 2a6b966caf858c5683660b644b7c2ee914e4e533 Mon Sep 17 00:00:00 2001 From: Jackson West Date: Sat, 2 Apr 2022 22:01:04 -0500 Subject: [PATCH 2/2] skip ctr pulling required images since the build removes them anyway Signed-off-by: Jackson West --- pkg/build/nodeimage/buildcontext.go | 48 +++++++++++++++-------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/pkg/build/nodeimage/buildcontext.go b/pkg/build/nodeimage/buildcontext.go index ecbaf6b1..6922a23a 100644 --- a/pkg/build/nodeimage/buildcontext.go +++ b/pkg/build/nodeimage/buildcontext.go @@ -257,29 +257,31 @@ func (c *buildContext) prePullImagesAndWriteManifests(bits kube.Bits, parsedVers } }() - fns := []func() error{} - for _, image := range requiredImages { - image := image // https://golang.org/doc/faq#closures_and_goroutines - fns = append(fns, func() error { - if !builtImages.Has(image) { - /* - TODO: show errors when we have real errors. See comments in - importer implementation - err := importer.Pull(image, dockerBuildOsAndArch(c.arch)) - if err != nil { - c.logger.Warnf("Failed to pull %s with error: %v", image, err) - runE := exec.RunErrorForError(err) - c.logger.Warn(string(runE.Output)) - } - */ - _ = importer.Pull(image, dockerBuildOsAndArch(c.arch)) - } - return nil - }) - } - if err := errors.AggregateConcurrent(fns); err != nil { - return nil, err - } + // The eks-a build process ends up removing all of these pulled images anyway + // skip pulling requiredimages, only import the kube images which are already on disk as tarballs + // fns := []func() error{} + // for _, image := range requiredImages { + // image := image // https://golang.org/doc/faq#closures_and_goroutines + // fns = append(fns, func() error { + // if !builtImages.Has(image) { + // /* + // TODO: show errors when we have real errors. See comments in + // importer implementation + // err := importer.Pull(image, dockerBuildOsAndArch(c.arch)) + // if err != nil { + // c.logger.Warnf("Failed to pull %s with error: %v", image, err) + // runE := exec.RunErrorForError(err) + // c.logger.Warn(string(runE.Output)) + // } + // */ + // _ = importer.Pull(image, dockerBuildOsAndArch(c.arch)) + // } + // return nil + // }) + // } + // if err := errors.AggregateConcurrent(fns); err != nil { + // return nil, err + // } // create a plan of image loading loadFns := []func() error{} -- 2.39.2