29 Commits

Author SHA1 Message Date
Daniel J Walsh
a3fef4879e Validate options
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
2017-09-28 17:07:03 +00:00
Daniel J Walsh
47665ad777 Cleanup buildah-commit code
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_@>
2017-09-26 18:11:26 +00:00
TomSweeneyRedHat
c9c735e20d Add authentication to commit and push
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #250
Approved by: rhatdan
2017-08-29 15:20:19 +00:00
TomSweeneyRedHat
498f0ae9d7 Add credentials to buildah from
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Add credentials to buildah from

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #204
Approved by: nalind
2017-08-22 18:55:38 +00:00
Daniel J Walsh
dd98523b8d Add flag to remove containers on commit
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
2017-07-17 19:07:21 +00:00
Nalin Dahyabhai
4a05d8643d Add an option to specify a Create date for images
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
2017-06-13 21:50:42 +00:00
Nalin Dahyabhai
45d3e7953b Use errors.Errorf() instead of fmt.Errorf()
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
2017-06-02 16:26:46 +00:00
Dan Walsh
8ced1276e5 Change functions that use a fmt.Errorf to wrap an err to error.Wrapf
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
2017-06-02 14:17:04 +00:00
Nalin Dahyabhai
4b6ba974cc Make the output image format selectable
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
2017-05-24 18:20:11 +00:00
Nalin Dahyabhai
12e582ee1a Report pull/commit progress by default
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
2017-05-10 12:53:25 +00:00
Nalin Dahyabhai
53f12844b2 Accept commit targets which are just store refs
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
2017-03-28 19:33:07 +00:00
Daniel J Walsh
b58b778ef3 Move all command definitions out of main.go into implementation source
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
2017-03-27 19:03:28 +00:00
Daniel J Walsh
c0b38746d3 Remove all --name and --root options
Also fix up buildah commit to require name and image
2017-03-24 14:05:25 -04:00
Nalin Dahyabhai
37d3ab9dca Merge pull request #26 from rhatdan/link
Remove link from CLI
2017-03-24 12:46:19 -04:00
Nalin Dahyabhai
5b8579d897 Merge pull request #25 from nalind/vendor-updates
Vendor updates
2017-03-23 16:49:24 -04:00
Daniel J Walsh
80f73013cd Remove link from CLI
We have decided not to support using the --link param in the CLI.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-03-23 14:59:20 -04:00
Daniel J Walsh
2ca263ad1e Default --root option to ENV BUILDAHROOT
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2017-03-22 16:33:46 -04:00
Nalin Dahyabhai
f0b508598a Update implementation to match dependencies
types.ImageSource.Close() can return an error now, and ParseImageName()
moved to containers/image/transports/alltransports.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-22 16:33:24 -04:00
Nalin Dahyabhai
9edc229948 commit: "do-not-compress" -> "disable-compression"
Rename the "commit" "--do-not-compress" flag to be called
"--disable-compression" instead.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-20 16:30:01 -04:00
Nalin Dahyabhai
ae1295b0c9 Tweak more help usage and descriptions
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-20 15:51:35 -04:00
Nalin Dahyabhai
0d83d9ebfa Pull required flag values from the arguments list
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>
2017-03-17 18:46:16 -04:00
Nalin Dahyabhai
f4be6fdc48 Don't mix "config" in with "run" and "commit"
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>
2017-03-17 18:46:15 -04:00
Nalin Dahyabhai
631cda1e5f Update flag Usage strings to highlight arg types
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>
2017-03-17 18:46:15 -04:00
Nalin Dahyabhai
a2ccec8c43 Catch up to the projectatomic move
Catch up import paths and docs to build correctly now that we're in
projectatomic.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-03-16 10:54:45 -04:00
Nalin Dahyabhai
83a1ec775e Clarify that we can find containers by name or ID
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>
2017-03-16 10:19:05 -04:00
Nalin Dahyabhai
0bbb076df8 Fix a copy/paste error in an error message
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>
2017-02-24 15:14:52 -05:00
Nalin Dahyabhai
0ab0890e4e Massive refactoring
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>
2017-02-10 11:48:15 -05:00
Nalin Dahyabhai
a15a927d8d Compress committed image layers by default
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>
2017-01-28 08:18:02 +01:00
Nalin Dahyabhai
02f30c773e Rename: lumper -> buildah
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-01-27 16:55:04 +01:00