mirror of
https://github.com/containers/podman.git
synced 2025-09-27 16:54:42 +08:00
Vendor in latest containers/buildah
This will take a significant size away from the podman-remote executables. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
8
vendor/github.com/containers/buildah/util/util.go
generated
vendored
8
vendor/github.com/containers/buildah/util/util.go
generated
vendored
@ -74,7 +74,7 @@ func ResolveName(name string, firstRegistry string, sc *types.SystemContext, sto
|
||||
return []string{strings.TrimPrefix(name, DefaultTransport)}, DefaultTransport, false, nil
|
||||
}
|
||||
split := strings.SplitN(name, ":", 2)
|
||||
if len(split) == 2 {
|
||||
if StartsWithValidTransport(name) && len(split) == 2 {
|
||||
if trans := transports.Get(split[0]); trans != nil {
|
||||
return []string{split[1]}, trans.Name(), false, nil
|
||||
}
|
||||
@ -148,6 +148,12 @@ func ResolveName(name string, firstRegistry string, sc *types.SystemContext, sto
|
||||
return candidates, DefaultTransport, searchRegistriesAreEmpty, nil
|
||||
}
|
||||
|
||||
// StartsWithValidTransport validates the name starts with Buildah supported transport
|
||||
// to avoid the corner case image name same as the transport name
|
||||
func StartsWithValidTransport(name string) bool {
|
||||
return strings.HasPrefix(name, "dir:") || strings.HasPrefix(name, "docker://") || strings.HasPrefix(name, "docker-archive:") || strings.HasPrefix(name, "docker-daemon:") || strings.HasPrefix(name, "oci:") || strings.HasPrefix(name, "oci-archive:")
|
||||
}
|
||||
|
||||
// ExpandNames takes unqualified names, parses them as image names, and returns
|
||||
// the fully expanded result, including a tag. Names which don't include a registry
|
||||
// name will be marked for the most-preferred registry (i.e., the first one in our
|
||||
|
Reference in New Issue
Block a user