Remove --transport flag

This is no simpler then putting the transport in the image page,
we should default to the registry specified in containers/image
and not override it.  People are confused by this option, and I
see no value.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #234
Approved by: rhatdan
This commit is contained in:
Daniel J Walsh 2017-08-23 06:47:13 -04:00 committed by Atomic Bot
parent 0de0d23df4
commit 52087ca1c5
7 changed files with 13 additions and 45 deletions

View File

@ -17,11 +17,6 @@ var (
Name: "quiet, q",
Usage: "refrain from announcing build instructions and image read/write progress",
},
cli.StringFlag{
Name: "transport",
Usage: "prefix to prepend to the image name in order to pull the image",
Value: DefaultTransport,
},
cli.BoolTFlag{
Name: "pull",
Usage: "pull the image if not present",
@ -82,10 +77,6 @@ func budCmd(c *cli.Context) error {
tags = tags[1:]
}
}
transport := DefaultTransport
if c.IsSet("transport") {
transport = c.String("transport")
}
pull := true
if c.IsSet("pull") {
pull = c.BoolT("pull")
@ -208,7 +199,6 @@ func budCmd(c *cli.Context) error {
options := imagebuildah.BuildOptions{
ContextDirectory: contextDir,
PullPolicy: pullPolicy,
Transport: transport,
Compression: imagebuildah.Gzip,
Quiet: quiet,
SignaturePolicyPath: signaturePolicy,

View File

@ -9,13 +9,6 @@ import (
"github.com/urfave/cli"
)
const (
// DefaultTransport is a prefix that we apply to an image name if we
// can't find one in the local Store, in order to generate a source
// reference for the image that we can then copy to the local Store.
DefaultTransport = "docker://"
)
var (
fromFlags = []cli.Flag{
cli.StringFlag{
@ -30,11 +23,6 @@ var (
Name: "pull-always",
Usage: "pull the image even if one with the same name is already present",
},
cli.StringFlag{
Name: "transport",
Usage: "`prefix` to prepend to the image name in order to pull the image",
Value: DefaultTransport,
},
cli.StringFlag{
Name: "cert-dir",
Value: "",
@ -81,10 +69,6 @@ func fromCmd(c *cli.Context) error {
}
image := args[0]
transport := DefaultTransport
if c.IsSet("transport") {
transport = c.String("transport")
}
systemContext, err := systemContextFromOptions(c)
if err != nil {
@ -131,7 +115,6 @@ func fromCmd(c *cli.Context) error {
FromImage: image,
Container: name,
PullPolicy: pullPolicy,
Transport: transport,
SignaturePolicyPath: signaturePolicy,
SystemContext: systemContext,
}

View File

@ -340,7 +340,6 @@ return 1
"
local options_with_args="
--transport
--signature-policy
--runtime
--runtime-flag
@ -621,7 +620,6 @@ return 1
--cert-dir
--creds
--name
--transport
--signature-policy
--tls-verify
"

View File

@ -35,12 +35,6 @@ Defaults to *true*.
Pull the image even if a version of the image is already present.
**--transport** *transport*
A prefix to prepend to the image name in order to pull the image. The default
value is "docker://". Note that no separator is implicitly added when the
values are combined.
**--signature-policy** *signaturepolicy*
Pathname of a signature policy file to use. It is not recommended that this

View File

@ -37,12 +37,6 @@ Defaults to *true*.
Pull the image even if a version of the image is already present.
**--transport** *transport*
A prefix to prepend to the image name in order to pull the image. The default
value is "docker://". Note that no separator is implicitly added when the
values are combined.
**--signature-policy** *signaturepolicy*
Pathname of a signature policy file to use. It is not recommended that this
@ -59,13 +53,13 @@ If an image needs to be pulled from the registry, suppress progress output.
## EXAMPLE
buildah from imagename --pull --transport "docker://myregistry.example.com/"
buildah from imagename --pull
buildah from docker://myregistry.example.com/imagename --pull
buildah from imagename --signature-policy /etc/containers/policy.json
buildah from imagename --pull-always --transport "docker://myregistry.example.com/" --name "mycontainer"
buildah from docker://myregistry.example.com/imagename --pull-always --name "mycontainer"
buildah from myregistry/myrepository/imagename:imagetag --creds=myusername:mypassword

9
new.go
View File

@ -18,6 +18,11 @@ const (
// BaseImageFakeName is the "name" of a source image which we interpret
// as "no image".
BaseImageFakeName = imagebuilder.NoBaseImageSpecifier
// DefaultTransport is a prefix that we apply to an image name if we
// can't find one in the local Store, in order to generate a source
// reference for the image that we can then copy to the local Store.
DefaultTransport = "docker://"
)
func newBuilder(store storage.Store, options BuilderOptions) (*Builder, error) {
@ -32,6 +37,10 @@ func newBuilder(store storage.Store, options BuilderOptions) (*Builder, error) {
}
image := options.FromImage
if options.Transport == "" {
options.Transport = DefaultTransport
}
systemContext := getSystemContext(options.SignaturePolicyPath)
imageID := ""

View File

@ -24,12 +24,12 @@ load helpers
buildah commit --signature-policy ${TESTSDIR}/policy.json $cid dir:${elsewhere}
buildah rm $cid
cid=$(buildah from --pull --signature-policy ${TESTSDIR}/policy.json --transport dir: ${elsewhere})
cid=$(buildah from --pull --signature-policy ${TESTSDIR}/policy.json dir:${elsewhere})
buildah rm $cid
buildah rmi ${elsewhere}
[ "$cid" = elsewhere-img-working-container ]
cid=$(buildah from --pull-always --signature-policy ${TESTSDIR}/policy.json --transport dir: ${elsewhere})
cid=$(buildah from --pull-always --signature-policy ${TESTSDIR}/policy.json dir:${elsewhere})
buildah rm $cid
buildah rmi ${elsewhere}
[ "$cid" = `basename ${elsewhere}`-working-container ]