summaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/import.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/import.go')
-rw-r--r--vendor/github.com/projectatomic/buildah/import.go24
1 files changed, 9 insertions, 15 deletions
diff --git a/vendor/github.com/projectatomic/buildah/import.go b/vendor/github.com/projectatomic/buildah/import.go
index b98219107..2a48d2c34 100644
--- a/vendor/github.com/projectatomic/buildah/import.go
+++ b/vendor/github.com/projectatomic/buildah/import.go
@@ -97,27 +97,21 @@ func importBuilder(ctx context.Context, store storage.Store, options ImportOptio
}
func importBuilderFromImage(ctx context.Context, store storage.Store, options ImportFromImageOptions) (*Builder, error) {
- var img *storage.Image
- var err error
-
if options.Image == "" {
return nil, errors.Errorf("image name must be specified")
}
systemContext := getSystemContext(options.SystemContext, options.SignaturePolicyPath)
- for _, image := range util.ResolveName(options.Image, "", systemContext, store) {
- img, err = util.FindImage(store, image)
- if err != nil {
- continue
- }
-
- builder, err2 := importBuilderDataFromImage(ctx, store, systemContext, img.ID, "", "")
- if err2 != nil {
- return nil, errors.Wrapf(err2, "error importing build settings from image %q", options.Image)
- }
+ _, img, err := util.FindImage(store, "", systemContext, options.Image)
+ if err != nil {
+ return nil, errors.Wrapf(err, "error locating image %q for importing settings", options.Image)
+ }
- return builder, nil
+ builder, err := importBuilderDataFromImage(ctx, store, systemContext, img.ID, "", "")
+ if err != nil {
+ return nil, errors.Wrapf(err, "error importing build settings from image %q", options.Image)
}
- return nil, errors.Wrapf(err, "error locating image %q for importing settings", options.Image)
+
+ return builder, nil
}