summaryrefslogtreecommitdiff
path: root/cmd/podman/inspect.go
Commit message (Collapse)AuthorAge
* Fixes for system testsBrent Baude2020-04-17
| | | | | | Various fixes to protect against regressions in system tests Signed-off-by: Brent Baude <bbaude@redhat.com>
* Podman V2 birthBrent Baude2020-04-16
| | | | | | remote podman v1 and replace with podman v2. Signed-off-by: Brent Baude <bbaude@redhat.com>
* inspect: rename ImageID go field to ImageValentin Rothberg2019-10-15
| | | | | | | | | | | | | | The json field is called `Image` while the go field is called `ImageID`, tricking users into filtering for `Image` which ultimately results in an error. Hence, rename the field to `Image` to align json and go. To prevent podman users from regressing, rename `Image` to `ImageID` in the specified filters. Add tests to prevent us from regressing. Note that consumers of the go API that are using `ImageID` are regressing; ultimately we consider it to be a bug fix. Fixes: #4193 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* golangci-lint round #3baude2019-07-21
| | | | | | | this is the third round of preparing to use the golangci-lint on our code base. Signed-off-by: baude <bbaude@redhat.com>
* Move the HostConfig portion of Inspect inside libpodMatthew Heon2019-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we first began writing Podman, we ran into a major issue when implementing Inspect. Libpod deliberately does not tie its internal data structures to Docker, and stores most information about containers encoded within the OCI spec. However, Podman must present a CLI compatible with Docker, which means it must expose all the information in 'docker inspect' - most of which is not contained in the OCI spec or libpod's Config struct. Our solution at the time was the create artifact. We JSON'd the complete CreateConfig (a parsed form of the CLI arguments to 'podman run') and stored it with the container, restoring it when we needed to run commands that required the extra info. Over the past month, I've been looking more at Inspect, and refactored large portions of it into Libpod - generating them from what we know about the OCI config and libpod's (now much expanded, versus previously) container configuration. This path comes close to completing the process, moving the last part of inspect into libpod and removing the need for the create artifact. This improves libpod's compatability with non-Podman containers. We no longer require an arbitrarily-formatted JSON blob to be present to run inspect. Fixes: #3500 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* first pass of corrections for golangci-lintbaude2019-07-10
| | | | Signed-off-by: baude <bbaude@redhat.com>
* Support aliases for .Src and .Dst in inspect .MountsMatthew Heon2019-06-24
| | | | | | | | | | This provides backwards compatability with 1.4.0-1.4.2 releases which name .Source and .Destination as .Src and .Dst - useful for not breaking toolbox. Also add a test. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* runtime: pass down the contextGiuseppe Scrivano2019-04-26
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Fix segfaults attribute to missing optionsbaude2019-04-15
| | | | | | | | | In cases where the remote client culls options to a command, we need to be sure that the lookup for that flag does not result in a nil pointer. To do so, we add a Remote attribute to the podman struct and then cli helper funcs are now aware they are remote. Signed-off-by: baude <bbaude@redhat.com>
* Remove ulele/deepcopier in favor of JSON deep copyMatthew Heon2019-03-27
| | | | | | | | | | | | | We have a very high performance JSON library that doesn't need to perform code generation. Let's use it instead of our questionably performant, reflection-dependent deep copy library. Most changes because some functions can now return errors. Also converts cmd/podman to use jsoniter, instead of pkg/json, for increased performance. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Usability cleanup for 'inspect'Ed Santiago2019-03-13
| | | | | | | | | | | | | | | | | Make the usage messages (and options) different between podman inspect, podman image inspect, and podman container inspect. Disable inapplicable options (-l, -s) for podman image inspect Disable -t (type) when the type is implicit through the subcommand. Update man page to reflect differences in usage. Fix broken test. Uglier than desirable due to Go and Cobra limitations Signed-off-by: Ed Santiago <santiago@redhat.com>
* move formats pkg to and vendor from buildahQi Wang2019-03-11
| | | | Signed-off-by: Qi Wang <qiwan@redhat.com>
* Fix help commands to show short and long description.Daniel J Walsh2019-03-07
| | | | | | Cleanup lots of help information to look good when displayed. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Better usage synopses for subcommandsEd Santiago2019-02-26
| | | | | | | Conceptually simple: include, where applicable, a brief description of command-line options for each subcommand. Signed-off-by: Ed Santiago <santiago@redhat.com>
* Enable more podman-remote pod commandsbaude2019-02-22
| | | | | | enable pod start, stop, and kill subcommands for the remote-client. Signed-off-by: baude <bbaude@redhat.com>
* hide --latest on the remote-clientbaude2019-02-22
| | | | | | | | in the case of the remote-client, it was decided to hide the latest flag to avoid confusion for end-users on what the "last" container, volume, or pod are. Signed-off-by: baude <bbaude@redhat.com>
* Add examples for CobraTomSweeneyRedHat2019-02-14
| | | | | | | Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com> First pass of entries for the Examples listed in the Cobra Help. Will add others in following PR's.
* Don't show global flags except for podman commandDaniel J Walsh2019-02-12
| | | | | | | | | Subcommands should not be showing the global flags. This causes the important information to scroll off the screen. Also fixed a typo on runCommmand (Too many 'm's) Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Separate remote and local commandsbaude2019-02-11
| | | | | | | | In the previous CLI, we had an accurate depiction of commands available for the remote client and those available for the local client. Signed-off-by: baude <bbaude@redhat.com>
* Migrate to cobra CLIbaude2019-02-08
| | | | | | | | We intend to migrate to the cobra cli from urfave/cli because the project is more well maintained. There are also some technical reasons as well which extend into our remote client work. Signed-off-by: baude <bbaude@redhat.com>
* Merge pull request #2239 from bodunov/masterOpenShift Merge Robot2019-02-01
|\ | | | | Consistency in verbs in podman help command
| * For consistency in usage output the verbs changed from 3rd person to 1st person.Ivan Bodunov2019-01-30
| | | | | | | | Signed-off-by: Ivan Bodunov <ivan.bodunov@gmail.com>
* | Add support for short option -s in podman inspectDaniel J Walsh2019-01-30
|/ | | | | | docker inspect supports a short -s option for --size. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* podman-remote inspectbaude2019-01-18
| | | | | | base enablement of the inspect command. Signed-off-by: baude <bbaude@redhat.com>
* podman-inspect: don't ignore errorsValentin Rothberg2019-01-18
| | | | | | | | | Return errors when executing the --format templates. Otherwise, Podman will just silently ignore them and not print any output that could guide user into solving the issue. Fixes: #2159 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Fix golang formatting issuesbaude2018-11-28
| | | | | | | Whe running unittests on newer golang versions, we observe failures with some formatting types when no declared correctly. Signed-off-by: baude <bbaude@redhat.com>
* Sort all command flagsQi Wang2018-10-11
| | | | Signed-off-by: Qi Wang <qiwan@redhat.com>
* don't print help message for usage errorsValentin Rothberg2018-08-31
| | | | | | | | | | | | | | | | | Don't print potentially verbose help messages in case of usage errors, but print only the usage error followed by a pointer to the command's help. This aligns with Docker. ``` $ podman run -h flag needs an argument: -h See 'podman run --help'. ``` Signed-off-by: Valentin Rothberg <vrothberg@suse.com> Closes: #1379 Approved by: rhatdan
* Change batchcontainer to sharedhaircommander2018-08-16
| | | | | | | | | To better reflect it's usage: to share functions between podman and varlink. Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1275 Approved by: mheon
* switch projectatomic to containersDaniel J Walsh2018-08-16
| | | | | | | | | | Need to get some small changes into libpod to pull back into buildah to complete buildah transition. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1270 Approved by: mheon
* return all inspect info for varlink containerinspectbaude2018-06-01
| | | | | | | | | | | when obtaining the inspect information for a container through varlink, we need to extract more container related information by parsing the data through the method 'GetCtrInspectInfo' which was previously only in podman's main. Signed-off-by: baude <bbaude@redhat.com> Closes: #866 Approved by: rhatdan
* Spell check strings and commentsJhon Honce2018-05-25
| | | | | | | Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #831 Approved by: rhatdan
* podman create, start, getattachsocketbaude2018-05-21
| | | | | | | | | First pass at implement API endpoints for create and start. Signed-off-by: baude <bbaude@redhat.com> Closes: #805 Approved by: baude
* Begin wiring in USERNS Support into podmanDaniel J Walsh2018-05-04
| | | | | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #690 Approved by: mheon
* varlink imagesbaude2018-04-26
| | | | | | | | | | | | | implement varlink image functions for working with libpod with the exception of a couple due to incompletions on the libpod side of things (build). also, created a first pass at a libpodpy package which will stand as a client to working with libpod's varlink methods using python. Signed-off-by: baude <bbaude@redhat.com> Closes: #669 Approved by: baude
* Vendor in latest containers/image and contaners/storageumohnani82018-04-19
| | | | | | | | | Made necessary changes to functions to include contex.Context wherever needed Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #640 Approved by: baude
* Migrate podman inspect and tag to image librarybaude2018-03-21
| | | | | | | Signed-off-by: baude <bbaude@redhat.com> Closes: #525 Approved by: baude
* Image library stage 4 - create and commitbaude2018-03-20
| | | | | | | | | | Migrate the podman create and commit subcommandis to leverage the images library. I also had to migrate the cmd/ portions of run and rmi. Signed-off-by: baude <bbaude@redhat.com> Closes: #498 Approved by: mheon
* Stage3 Image Librarybaude2018-03-14
| | | | | | | | | | | | | This represents the stage3 implementation for the image library. At this point, we are moving the image-centric functions to pkg/image including migration of args and object-oriented references. This is a not a one-for-one migration of funcs and some funcs will need to continue to reside in runtime_img as they are overly specific to libpod and probably not useful to others. Signed-off-by: baude <bbaude@redhat.com> Closes: #484 Approved by: baude
* Include tmpfs in inspectbaude2018-03-14
| | | | | | | | | | | | Other container runtimes include the tmpfs mount points in their inspect output. Podman should as well. It is under hostconfig. Resolves: #483 Signed-off-by: baude <bbaude@redhat.com> Closes: #488 Approved by: rhatdan
* Tagging an image alias by shortnamebaude2018-02-26
| | | | | | | | | | | | | | | | | | When trying to tag an alias (tag) of an image using only the shortname and no tag, we were unable to find the image in storage. This corrects that issue and adds an integration test to protect against regression. I also updated the man page per the filed issue. While writing the integration test, I discovered that inspect could also not find a tagged image without its :tag. Resolves Issue #385 Resolves Issue #384 Signed-off-by: baude <bbaude@redhat.com> Closes: #398 Approved by: mheon
* Inspect output should be in array formbaude2018-02-21
| | | | | | | | | | | | | | | | | | | | | | | | Inspect should be able to inspect one or more containers depending on the user input. Therefore, inspect output should be in array format so the consumer could potentially iterate it. This PR allows users to specify one more or containers|images|or a mix for inspection. The output, as stated, is therefore in array form. This holds true even for a singular image. In the case that the user enters an invalid container|image "name", we handle that gracefully. Podman will output json for the valid names until it reaches the invalid one. For example: In this case, podman will out the json for alpine and then print an error about 123 being invalid. It will not continute onto busybox. This behavior imatates docker. This addresses issue #360 Signed-off-by: baude <bbaude@redhat.com> Closes: #371 Approved by: baude
* Change json to match docker inspectDaniel J Walsh2018-02-11
| | | | | | | | | | Changing these fields caused the output of podman inspect to more closely match docker inspect. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #306 Approved by: mheon
* Honor ENTRYPOINT in imagebaude2018-02-11
| | | | | | | | | | | | | When an image has an ENTRYPOINT defined, we should be honoring it. The problem is described in issue #321. Also, added buildah binary to test runtimes for testing entrypoint and will also allow us to test podman build as well. Signed-off-by: baude <bbaude@redhat.com> Closes: #322 Approved by: rhatdan
* Match podman inspect output to docker inspectumohnani82018-02-06
| | | | | | | | | | | | Made a change to make sure that the output paths of podman inspect matches that of docker inspect. For example to get the stop signal you should be able to do podman inspect ctr --format {{.Config.StopSignal}} and the same thing in docker will give the same results. Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #292 Approved by: rhatdan
* Migrate Create|Commit to ginkgobaude2018-02-02
| | | | | | | | | | | | Migrate create and commit bats tests to the ginkgo test suite. In doing so, some structures had to be moved to pkg/podmanstructs/podmanstructs.go so we could do better verification of test results. Signed-off-by: baude <bbaude@redhat.com> Closes: #286 Approved by: rhatdan
* Save --privileged stateDaniel J Walsh2018-01-25
| | | | | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #255 Approved by: mheon
* Add support for shm-size.Daniel J Walsh2018-01-11
| | | | | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #206 Approved by: TomSweeneyRedHat
* Shortcut for most recent containerbaude2018-01-08
| | | | | | | | | | | | It is desirable to have a shortcut for the most recently created container. We can now use "**latest" to represent the most recent container instead of its container ID or name. For example: Signed-off-by: baude <bbaude@redhat.com> Closes: #179 Approved by: baude
* podman create/run need to load information from the imageDaniel J Walsh2018-01-03
| | | | | | | | | | We should be pulling information out of the image to set the defaults to use when setting up the container. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #110 Approved by: mheon