kpod must parse the crio configuration file or the storage
is not set up correctly. By default it is not. We now read
/etc/crio/crio.conf in as the configuration file unless it is
overriden by the user and the global -c|--config switch.
Signed-off-by: baude <bbaude@redhat.com>
The getCommand func strips out unwanted characters around the
command of the container. The JSON output should use this func
like the regular ps output for both consistency and because
Python does a literal interpretation of the bracket [] characters
when consuming as JSON.
Signed-off-by: baude <bbaude@redhat.com>
Some kpod commands were listed twice in main.go. Removed these
duplicates and alphabetized the remaining commands to prevent this
from happening in the future
Signed-off-by: Ryan Cole <rcyoalne@gmail.com>
Consumers of the json output, like the atomic cli, need the ID of the
image for the container as well as the name. Specifically, it is used
to tract "used" and "vulnerable" images.
Signed-off-by: baude <bbaude@redhat.com>
Have the "kpod info" command also package up the driver-level status
information that the github.com/containers/storage.Store's Status()
method returns.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
No reason to carry this temporary variable for documentation purposes.
If in the future we find that it is necessary to add a CLI option, we
can add the variable then.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Changed the JSON output to hold the actual type of the data.
For example the creation time of a container will be of form time.Time.
The human readable output modifies all the fields to type string, which
is not helpful when the JSON output wants to be used for further processing.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Before exiting, have kpod shut down the storage library if it can. This
should keep us from leaving mountpoints for the root (for non-vfs cases)
and run directory (with newer containers/storage) busy when testing kpod.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
We want all kpod subcommands to use the formats code to output
formats like json. Altering kpod diff --json to kpod diff --format json
like the kpod images command.
Signed-off-by: baude <bbaude@redhat.com>
Add functions to go templates such as truncating a field. Also add
the table keyword, which, if placed at the beginning of a format string,
adds headers to the output
Signed-off-by: Ryan Cole <rcyoalne@gmail.com>
This allows the container list API to return updated status
for exited container without having to call container status first.
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
For kpod images, we need to output in JSON format so that consumers
(programatic) have structured input to work with.
kpod images --format json
Signed-off-by: baude <bbaude@redhat.com>
Also set default level of logging to errors, we should not see
info messages in the kpod command line.
While adding this patch, I found missing options in kpod command line
and bash completions, so I added them in.
Also fixed some sorting issues in the way commands are displayer in help or in
bash completions.
Finally fixed the error message to be output on failure using logrus.Errorf, so
we don't get the stack any longer.
Also updated README.md with missing kpod commands.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
kpod diff reports on differences between two layers, specified as
layer IDs, containers, or images. In the case of containers or
images, kpod diff produces a diff for the top layer
Signed-off-by: Ryan Cole <rcyoalne@gmail.com>
We add two flags --enable-metrics and --metrics-port
to enable metrics endpoint and allow specifying the
port which defaults to 9090.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>