"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/github.com/containers/image/v5/transports/alltransports/alltransports.go" between
buildah-1.26.2.tar.gz and buildah-1.26.3.tar.gz

About: Buildah is a tool that facilitates building Open Container Initiative (OCI) container images.

alltransports.go  (buildah-1.26.2):alltransports.go  (buildah-1.26.3)
package alltransports package alltransports
import ( import (
"fmt"
"strings" "strings"
// register all known transports // register all known transports
// NOTE: Make sure docs/containers-policy.json.5.md is updated when addin g or updating // NOTE: Make sure docs/containers-policy.json.5.md is updated when addin g or updating
// a transport. // a transport.
_ "github.com/containers/image/v5/directory" _ "github.com/containers/image/v5/directory"
_ "github.com/containers/image/v5/docker" _ "github.com/containers/image/v5/docker"
_ "github.com/containers/image/v5/docker/archive" _ "github.com/containers/image/v5/docker/archive"
_ "github.com/containers/image/v5/oci/archive" _ "github.com/containers/image/v5/oci/archive"
_ "github.com/containers/image/v5/oci/layout" _ "github.com/containers/image/v5/oci/layout"
_ "github.com/containers/image/v5/openshift" _ "github.com/containers/image/v5/openshift"
_ "github.com/containers/image/v5/sif" _ "github.com/containers/image/v5/sif"
_ "github.com/containers/image/v5/tarball" _ "github.com/containers/image/v5/tarball"
// The ostree transport is registered by ostree*.go // The ostree transport is registered by ostree*.go
// The storage transport is registered by storage*.go // The storage transport is registered by storage*.go
"github.com/containers/image/v5/transports" "github.com/containers/image/v5/transports"
"github.com/containers/image/v5/types" "github.com/containers/image/v5/types"
"github.com/pkg/errors"
) )
// ParseImageName converts a URL-like image name to a types.ImageReference. // ParseImageName converts a URL-like image name to a types.ImageReference.
func ParseImageName(imgName string) (types.ImageReference, error) { func ParseImageName(imgName string) (types.ImageReference, error) {
// Keep this in sync with TransportFromImageName! // Keep this in sync with TransportFromImageName!
parts := strings.SplitN(imgName, ":", 2) parts := strings.SplitN(imgName, ":", 2)
if len(parts) != 2 { if len(parts) != 2 {
return nil, errors.Errorf(`Invalid image name "%s", expected colo n-separated transport:reference`, imgName) return nil, fmt.Errorf(`Invalid image name "%s", expected colon-s eparated transport:reference`, imgName)
} }
transport := transports.Get(parts[0]) transport := transports.Get(parts[0])
if transport == nil { if transport == nil {
return nil, errors.Errorf(`Invalid image name "%s", unknown trans port "%s"`, imgName, parts[0]) return nil, fmt.Errorf(`Invalid image name "%s", unknown transpor t "%s"`, imgName, parts[0])
} }
return transport.ParseReference(parts[1]) return transport.ParseReference(parts[1])
} }
// TransportFromImageName converts an URL-like name to a types.ImageTransport or nil when // TransportFromImageName converts an URL-like name to a types.ImageTransport or nil when
// the transport is unknown or when the input is invalid. // the transport is unknown or when the input is invalid.
func TransportFromImageName(imageName string) types.ImageTransport { func TransportFromImageName(imageName string) types.ImageTransport {
// Keep this in sync with ParseImageName! // Keep this in sync with ParseImageName!
parts := strings.SplitN(imageName, ":", 2) parts := strings.SplitN(imageName, ":", 2)
if len(parts) == 2 { if len(parts) == 2 {
 End of changes. 4 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)