Builder has the Config and the Manifest fields which are []byte.
The type is []byte because it's eaiser to serialize them that way.
However, when these fields are displayed in the following way:
buildah inspect -f '{{.Config}} {{.Manifest}}' IMAGE
they might be shown as a byte slice.
This patch suggests to use a struct that wraps Builder's exposed
fields such as Config, Manifest and Container as strings and
thus make them readable when inspecting specific field.
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
Closes: #368
Approved by: rhatdan
When locating an image for pulling, inspection, or pushing, if we're
given an image name that doesn't include a domain/registry, try building
a set of candidate names using the configured registries as domains, and
then pull/inspect/push using the first of those names that works.
If a name that we're given corresponds to a prefix of the ID of a local
image, skip completion and use the ID directly instead.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #360
Approved by: rhatdan
buildah bud was not setting the mount label on the image
so SELinux in enforcing mode is blocking writing to the image
This patch also fixes a similar problem with the `buildah mount`
command
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #332
Approved by: TomSweeneyRedHat
buildah push and from now use the credentials stored in ${XDG_RUNTIME_DIR}/containers/auth.json by kpod login
if the auth file path is changed, buildah push and from can get the credentials from the custom auth file
using the --authfile flag
e.g buildah push --authfile /tmp/auths/myauths.json alpine docker://username/image
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Closes: #325
Approved by: rhatdan
buildah push supports manifest type conversion when pushing using the 'dir' transport
Manifest types include oci, v2s1, and v2s2
e.g buildah push --format v2s2 alpine dir:my-directory
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Closes: #321
Approved by: rhatdan
This patch will allow for the possibility of a valid "-"
option value. This is often used for taking from STDIN,
and should future proof us from this breaking if ever added.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Add options for specifying the root location when we're running unit
tests, so that we don't try to use the system's default location, which
we should avoid messing with if we can.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
In unit tests that assume that one or more images are present, make sure
we actually have pulled some images.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
When we added more spaces between the columns of output from the
"images" command, we didn't update the test to expect it.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
The "images" command was erroneously listing images that don't have
names twice, once with no name, and a second time with "<none>" as a
placeholder.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #280
Approved by: rhatdan
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
Part of the general buildah code cleanup.
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_@>
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_@>
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_@>
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_@>
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_@>
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_@>
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_@>
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_@>
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_@>
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_@>
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_@>
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
We have implemented most of this code in kpod export, and we now
have kpod import/load/save. No reason to implement them in both
commands.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #245
Approved by: nalind
Replace --registry command line flags with --transport. For backward
compatibility, add Transport as an addtional setting that we prepend to
the still-optional Registry setting if the Transport and image name
alone don't provide a parseable image reference.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #235
Approved by: rhatdan
Avoid parsing metadata that the image library keeps in order to find an
image's digest and creation date; instead, compute the digest from the
manifest, and read the creation date value by inspecting the image,
logging a debug-level diagnostic if it doesn't match the value that the
storage library has on record.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #218
Approved by: rhatdan
Use the storage library's new public field for retrieving an image's
creation date.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #218
Approved by: rhatdan
Return a "doesn't match" result if an image's ID can't be turned into a
valid reference for any reason.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #217
Approved by: rhatdan
Have storageImageID() use a lower-level image lookup to let it handle
truncated IDs correctly. Wrap errors in getImage(). When reporting
that an image is in use, report its ID correctly.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #211
Approved by: rhatdan
In-memory image objects created using an ImageReference's NewImage()
method need to be Close()d.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #211
Approved by: rhatdan