mirror of
https://github.com/containers/podman.git
synced 2025-05-17 23:26:08 +08:00
Vendor in latest projectatomic/buildah
Fixes to podman build for unknown image and ADD with url when doing --layers. Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #1330 Approved by: mheon
This commit is contained in:
@ -161,7 +161,10 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai
|
|||||||
importBuilder.SetWorkDir(splitChange[1])
|
importBuilder.SetWorkDir(splitChange[1])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
candidates := util.ResolveName(destImage, "", sc, c.runtime.store)
|
candidates, err := util.ResolveName(destImage, "", sc, c.runtime.store)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(err, "error resolving name %q", destImage)
|
||||||
|
}
|
||||||
if len(candidates) == 0 {
|
if len(candidates) == 0 {
|
||||||
return nil, errors.Errorf("error parsing target image name %q", destImage)
|
return nil, errors.Errorf("error parsing target image name %q", destImage)
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ k8s.io/kube-openapi 275e2ce91dec4c05a4094a7b1daee5560b555ac9 https://github.com/
|
|||||||
k8s.io/utils 258e2a2fa64568210fbd6267cf1d8fd87c3cb86e https://github.com/kubernetes/utils
|
k8s.io/utils 258e2a2fa64568210fbd6267cf1d8fd87c3cb86e https://github.com/kubernetes/utils
|
||||||
github.com/mrunalp/fileutils master
|
github.com/mrunalp/fileutils master
|
||||||
github.com/varlink/go master
|
github.com/varlink/go master
|
||||||
github.com/projectatomic/buildah 3bdbcdf6488771d8cd080a38904111c95f52990e
|
github.com/projectatomic/buildah 745bf7e56bda740ce7cfc55318da08529e5ed519
|
||||||
github.com/Nvveen/Gotty master
|
github.com/Nvveen/Gotty master
|
||||||
github.com/fsouza/go-dockerclient master
|
github.com/fsouza/go-dockerclient master
|
||||||
github.com/openshift/imagebuilder master
|
github.com/openshift/imagebuilder master
|
||||||
|
2
vendor/github.com/projectatomic/buildah/README.md
generated
vendored
2
vendor/github.com/projectatomic/buildah/README.md
generated
vendored
@ -1,6 +1,6 @@
|
|||||||

|

|
||||||
|
|
||||||
# [Buildah](https://www.youtube.com/embed/YVk5NgSiUw8) - a tool that facilitates building OCI container images
|
# [Buildah](https://www.youtube.com/embed/YVk5NgSiUw8) - a tool that facilitates building [Open Container Initiative (OCI)](https://www.opencontainers.org/) container images
|
||||||
|
|
||||||
[](https://goreportcard.com/report/github.com/projectatomic/buildah)
|
[](https://goreportcard.com/report/github.com/projectatomic/buildah)
|
||||||
[](https://travis-ci.org/projectatomic/buildah)
|
[](https://travis-ci.org/projectatomic/buildah)
|
||||||
|
8
vendor/github.com/projectatomic/buildah/imagebuildah/build.go
generated
vendored
8
vendor/github.com/projectatomic/buildah/imagebuildah/build.go
generated
vendored
@ -725,7 +725,10 @@ func (b *Executor) resolveNameToImageRef() (types.ImageReference, error) {
|
|||||||
if b.output != "" {
|
if b.output != "" {
|
||||||
imageRef, err = alltransports.ParseImageName(b.output)
|
imageRef, err = alltransports.ParseImageName(b.output)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
candidates := util.ResolveName(b.output, "", b.systemContext, b.store)
|
candidates, err := util.ResolveName(b.output, "", b.systemContext, b.store)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(err, "error parsing target image name %q: %v", b.output)
|
||||||
|
}
|
||||||
if len(candidates) == 0 {
|
if len(candidates) == 0 {
|
||||||
return nil, errors.Errorf("error parsing target image name %q", b.output)
|
return nil, errors.Errorf("error parsing target image name %q", b.output)
|
||||||
}
|
}
|
||||||
@ -962,6 +965,7 @@ func (b *Executor) getFilesToCopy(node *parser.Node) ([]string, error) {
|
|||||||
}
|
}
|
||||||
if strings.HasPrefix(currNode.Value, "http://") || strings.HasPrefix(currNode.Value, "https://") {
|
if strings.HasPrefix(currNode.Value, "http://") || strings.HasPrefix(currNode.Value, "https://") {
|
||||||
src = append(src, currNode.Value)
|
src = append(src, currNode.Value)
|
||||||
|
currNode = currNode.Next
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
matches, err := filepath.Glob(filepath.Join(b.contextDir, currNode.Value))
|
matches, err := filepath.Glob(filepath.Join(b.contextDir, currNode.Value))
|
||||||
@ -1143,7 +1147,7 @@ func (b *Executor) Build(ctx context.Context, stages imagebuilder.Stages) error
|
|||||||
for _, stage := range stages {
|
for _, stage := range stages {
|
||||||
stageExecutor = b.withName(stage.Name, stage.Position)
|
stageExecutor = b.withName(stage.Name, stage.Position)
|
||||||
if err := stageExecutor.Prepare(ctx, stage.Builder, stage.Node, ""); err != nil {
|
if err := stageExecutor.Prepare(ctx, stage.Builder, stage.Node, ""); err != nil {
|
||||||
lastErr = err
|
return err
|
||||||
}
|
}
|
||||||
// Always remove the intermediate/build containers, even if the build was unsuccessful.
|
// Always remove the intermediate/build containers, even if the build was unsuccessful.
|
||||||
// If building with layers, remove all intermediate/build containers if b.forceRmIntermediateCtrs
|
// If building with layers, remove all intermediate/build containers if b.forceRmIntermediateCtrs
|
||||||
|
6
vendor/github.com/projectatomic/buildah/new.go
generated
vendored
6
vendor/github.com/projectatomic/buildah/new.go
generated
vendored
@ -140,7 +140,11 @@ func newContainerIDMappingOptions(idmapOptions *IDMappingOptions) storage.IDMapp
|
|||||||
func resolveImage(ctx context.Context, systemContext *types.SystemContext, store storage.Store, options BuilderOptions) (types.ImageReference, *storage.Image, error) {
|
func resolveImage(ctx context.Context, systemContext *types.SystemContext, store storage.Store, options BuilderOptions) (types.ImageReference, *storage.Image, error) {
|
||||||
var ref types.ImageReference
|
var ref types.ImageReference
|
||||||
var img *storage.Image
|
var img *storage.Image
|
||||||
for _, image := range util.ResolveName(options.FromImage, options.Registry, systemContext, store) {
|
images, err := util.ResolveName(options.FromImage, options.Registry, systemContext, store)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, errors.Wrapf(err, "error parsing reference to image %q", options.FromImage)
|
||||||
|
}
|
||||||
|
for _, image := range images {
|
||||||
var err error
|
var err error
|
||||||
if len(image) >= minimumTruncatedIDLength {
|
if len(image) >= minimumTruncatedIDLength {
|
||||||
if img, err = store.Image(image); err == nil && img != nil && strings.HasPrefix(img.ID, image) {
|
if img, err = store.Image(image); err == nil && img != nil && strings.HasPrefix(img.ID, image) {
|
||||||
|
29
vendor/github.com/projectatomic/buildah/util/util.go
generated
vendored
29
vendor/github.com/projectatomic/buildah/util/util.go
generated
vendored
@ -63,17 +63,17 @@ var (
|
|||||||
// ResolveName checks if name is a valid image name, and if that name doesn't
|
// ResolveName checks if name is a valid image name, and if that name doesn't
|
||||||
// include a domain portion, returns a list of the names which it might
|
// include a domain portion, returns a list of the names which it might
|
||||||
// correspond to in the set of configured registries.
|
// correspond to in the set of configured registries.
|
||||||
func ResolveName(name string, firstRegistry string, sc *types.SystemContext, store storage.Store) []string {
|
func ResolveName(name string, firstRegistry string, sc *types.SystemContext, store storage.Store) ([]string, error) {
|
||||||
if name == "" {
|
if name == "" {
|
||||||
return nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maybe it's a truncated image ID. Don't prepend a registry name, then.
|
// Maybe it's a truncated image ID. Don't prepend a registry name, then.
|
||||||
if len(name) >= minimumTruncatedIDLength {
|
if len(name) >= minimumTruncatedIDLength {
|
||||||
if img, err := store.Image(name); err == nil && img != nil && strings.HasPrefix(img.ID, name) {
|
if img, err := store.Image(name); err == nil && img != nil && strings.HasPrefix(img.ID, name) {
|
||||||
// It's a truncated version of the ID of an image that's present in local storage;
|
// It's a truncated version of the ID of an image that's present in local storage;
|
||||||
// we need to expand the ID.
|
// we need only expand the ID.
|
||||||
return []string{img.ID}
|
return []string{img.ID}, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,18 +81,18 @@ func ResolveName(name string, firstRegistry string, sc *types.SystemContext, sto
|
|||||||
split := strings.SplitN(name, ":", 2)
|
split := strings.SplitN(name, ":", 2)
|
||||||
if len(split) == 2 {
|
if len(split) == 2 {
|
||||||
if _, ok := Transports[split[0]]; ok {
|
if _, ok := Transports[split[0]]; ok {
|
||||||
return []string{split[1]}
|
return []string{split[1]}, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the image name already included a domain component, we're done.
|
// If the image name already included a domain component, we're done.
|
||||||
named, err := reference.ParseNormalizedNamed(name)
|
named, err := reference.ParseNormalizedNamed(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []string{name}
|
return nil, errors.Wrapf(err, "error parsing image name %q", name)
|
||||||
}
|
}
|
||||||
if named.String() == name {
|
if named.String() == name {
|
||||||
// Parsing produced the same result, so there was a domain name in there to begin with.
|
// Parsing produced the same result, so there was a domain name in there to begin with.
|
||||||
return []string{name}
|
return []string{name}, nil
|
||||||
}
|
}
|
||||||
if reference.Domain(named) != "" && RegistryDefaultPathPrefix[reference.Domain(named)] != "" {
|
if reference.Domain(named) != "" && RegistryDefaultPathPrefix[reference.Domain(named)] != "" {
|
||||||
// If this domain can cause us to insert something in the middle, check if that happened.
|
// If this domain can cause us to insert something in the middle, check if that happened.
|
||||||
@ -109,7 +109,7 @@ func ResolveName(name string, firstRegistry string, sc *types.SystemContext, sto
|
|||||||
defaultPrefix := RegistryDefaultPathPrefix[reference.Domain(named)] + "/"
|
defaultPrefix := RegistryDefaultPathPrefix[reference.Domain(named)] + "/"
|
||||||
if strings.HasPrefix(repoPath, defaultPrefix) && path.Join(domain, repoPath[len(defaultPrefix):])+tag+digest == name {
|
if strings.HasPrefix(repoPath, defaultPrefix) && path.Join(domain, repoPath[len(defaultPrefix):])+tag+digest == name {
|
||||||
// Yup, parsing just inserted a bit in the middle, so there was a domain name there to begin with.
|
// Yup, parsing just inserted a bit in the middle, so there was a domain name there to begin with.
|
||||||
return []string{name}
|
return []string{name}, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ func ResolveName(name string, firstRegistry string, sc *types.SystemContext, sto
|
|||||||
candidate := path.Join(registry, middle, name)
|
candidate := path.Join(registry, middle, name)
|
||||||
candidates = append(candidates, candidate)
|
candidates = append(candidates, candidate)
|
||||||
}
|
}
|
||||||
return candidates
|
return candidates, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExpandNames takes unqualified names, parses them as image names, and returns
|
// ExpandNames takes unqualified names, parses them as image names, and returns
|
||||||
@ -156,7 +156,10 @@ func ExpandNames(names []string, firstRegistry string, systemContext *types.Syst
|
|||||||
expanded := make([]string, 0, len(names))
|
expanded := make([]string, 0, len(names))
|
||||||
for _, n := range names {
|
for _, n := range names {
|
||||||
var name reference.Named
|
var name reference.Named
|
||||||
nameList := ResolveName(n, firstRegistry, systemContext, store)
|
nameList, err := ResolveName(n, firstRegistry, systemContext, store)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Wrapf(err, "error parsing name %q", n)
|
||||||
|
}
|
||||||
if len(nameList) == 0 {
|
if len(nameList) == 0 {
|
||||||
named, err := reference.ParseNormalizedNamed(n)
|
named, err := reference.ParseNormalizedNamed(n)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -189,7 +192,11 @@ func FindImage(store storage.Store, firstRegistry string, systemContext *types.S
|
|||||||
var ref types.ImageReference
|
var ref types.ImageReference
|
||||||
var img *storage.Image
|
var img *storage.Image
|
||||||
var err error
|
var err error
|
||||||
for _, name := range ResolveName(image, firstRegistry, systemContext, store) {
|
names, err := ResolveName(image, firstRegistry, systemContext, store)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, errors.Wrapf(err, "error parsing name %q", image)
|
||||||
|
}
|
||||||
|
for _, name := range names {
|
||||||
ref, err = is.Transport.ParseStoreReference(store, name)
|
ref, err = is.Transport.ParseStoreReference(store, name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Debugf("error parsing reference to image %q: %v", name, err)
|
logrus.Debugf("error parsing reference to image %q: %v", name, err)
|
||||||
|
2
vendor/github.com/projectatomic/buildah/vendor.conf
generated
vendored
2
vendor/github.com/projectatomic/buildah/vendor.conf
generated
vendored
@ -46,7 +46,7 @@ github.com/containers/libpod d20f3a51463ce75d139dd830e19a173906b0b0cb
|
|||||||
github.com/sirupsen/logrus master
|
github.com/sirupsen/logrus master
|
||||||
github.com/syndtr/gocapability master
|
github.com/syndtr/gocapability master
|
||||||
github.com/tchap/go-patricia master
|
github.com/tchap/go-patricia master
|
||||||
github.com/urfave/cli fix-short-opts-parsing https://github.com/vrothberg/cli
|
github.com/urfave/cli 934abfb2f102315b5794e15ebc7949e4ca253920
|
||||||
github.com/vbatts/tar-split v0.10.2
|
github.com/vbatts/tar-split v0.10.2
|
||||||
github.com/xeipuuv/gojsonpointer master
|
github.com/xeipuuv/gojsonpointer master
|
||||||
github.com/xeipuuv/gojsonreference master
|
github.com/xeipuuv/gojsonreference master
|
||||||
|
Reference in New Issue
Block a user