If an string option is passed in, and it is not followed by a value,
then error out with a message saying the option requires a value.
For example
buildah from --creds --pull dan
option --creds requires a value
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #270
Approved by: rhatdan
1. Sort options so they are in alphabet order
2. Remove extra lines of code for options parsing that really do not accomplish anything.
3. Remove variables when they are not necessary, I.E. Don't create a variable to hold an
option that is only used once, use the option instead.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #267
Approved by: <username_without_leading_@>
I think this would be good practice to eliminate wasted disk space.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #189
Approved by: rhatdan
Add CommitOption option that to allow a caller to specify a creation
timestamp to use in images.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #141
Approved by: rhatdan
Use Errorf() from 'errors' rather than 'fmt' to help with stack traces.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #130
Approved by: rhatdan
Impove error reporting by wrapping all returned err functions with
error.Wrapf
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #124
Approved by: nalind
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Closes: #125
Approved by: nalind
Make it possible to select the output format for Commit() and the
imagebuildah package, and wire that through to a --format option in the
CLI's "commit" and "bud" commands.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #118
Approved by: rhatdan
Have 'from', 'commit', and 'build-using-dockerfile' report progress via
stderr (so that capturing output from 'from' and 'commit' still works as
expected) unless --quiet is used to suppress the reporting.
Closes#94.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #98
Approved by: rhatdan
Accept commit target names which don't include a transport name by
checking if they parse as valid containers-storage references after they
fail to parse as a general reference.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #49
Approved by: rhatdan
This will allow us to more easily share these source modules between
kpod and buildah as well as move keep the definition with the implementation.
Closes: #45
Approved by: rhatdan
types.ImageSource.Close() can return an error now, and ParseImageName()
moved to containers/image/transports/alltransports.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When flags that we'd require be specified aren't, if there are command
line arguments, use their values as flag values.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Don't mix "config" options in with the "run" and "commit" commands. It
might have made sense before "config" was a separate command, but it
doesn't any more, and it might suggest that settings changed during
"run" are temporary, when they are not.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Update the Usage strings that we include in Flag structures so that the
type of argument displayed in help output isn't just "value".
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Clarify that the --name option can also specify a container ID, and the
right things will still happen.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When we encounter an error parsing the target (new) image name during
"commit", don't use the container's name in the error message where we
meant to mention the image's name.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Pull most of the core logic from the CLI into a package that should be
easier to consume as a library. Add a "config" command that updates the
builder object's configuration.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When committing an image, default to compressing the layer using Gzip.
This can lead to problems pulling the image back out of
containers/storage if the package that pulls it out was built using a
different version of go, but it works around a problem where
containers/image might not be able to detect that an uncompressed layer
is actually a layer.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>