summaryrefslogtreecommitdiff
path: root/cmd
Commit message (Collapse)AuthorAge
* Merge pull request #14272 from Luap99/completion2OpenShift Merge Robot2022-05-19
|\ | | | | shell completion: use more constants in the code
| * shell completion: use more constants instead of duplicating stringsPaul Holzinger2022-05-19
| | | | | | | | | | | | | | | | | | It is better to just reuse the existing constants instead of duplicating the strings. [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger <pholzing@redhat.com>
| * shell completion: podman save --format use all valid valuesPaul Holzinger2022-05-19
| | | | | | | | | | | | | | docker-archive was missing from the completions. To prevent duplication use the same format list as podman save. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
| * shell completion: update podman inspect --type optionsPaul Holzinger2022-05-19
| | | | | | | | | | | | | | | | | | Add all option that are supported by the podman inspect --type flag to the completions. Also use the same constants instead of duplicating the strings. In order to do this I had to move the definitions into the common package to prevent an import cycle. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
| * shell completion: fix podman event --filter valuesPaul Holzinger2022-05-19
| | | | | | | | | | | | | | | | The completion suggested incorrect values for `podman events --filter type=` . It should only list types not the event status. Also make sure to use the constants instead of duplicating the strings. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | linter: enable unconvert linterValentin Rothberg2022-05-19
|/ | | | | | | Detects unneccessary type conversions and helps in keeping the code base cleaner. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* Fix strange buildtag editJason T. Greene2022-05-13
| | | | Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
* Add support for machine events on WindowsJason T. Greene2022-05-12
| | | | Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
* Merge pull request #14159 from vrothberg/service-containerDaniel J Walsh2022-05-12
|\ | | | | play kube: service container
| * play kube: service containerValentin Rothberg2022-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the notion of a "service container" to play kube. A service container is started before the pods in play kube and is (reverse) linked to them. The service container is stopped/removed *after* all pods it is associated with are stopped/removed. In other words, a service container tracks the entire life cycle of a service started via `podman play kube`. This is required to enable `play kube` in a systemd unit file. The service container is only used when the `--service-container` flag is set on the CLI. This flag has been marked as hidden as it is not meant to be used outside the context of `play kube`. It is further not supported on the remote client. The wiring with systemd will be done in a later commit. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | Merge pull request #14216 from Luap99/format-completionOpenShift Merge Robot2022-05-12
|\ \ | |/ |/| shell completion --format: work with pointer functions
| * shell completion --format: work with pointer functionsPaul Holzinger2022-05-12
| | | | | | | | | | | | | | | | | | | | | | The completion logic currently suggest also the functions that are defined for this type. However this did not work correctly when it was defined as pointer to that type on not the actual type. This commit fixes that problem. To test you can compare the difference between `podman stats --format {{.[TAB]` with and without this commit. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | Merge pull request #14170 from ashley-cui/machtestsOpenShift Merge Robot2022-05-11
|\ \ | | | | | | Add more machine tests
| * | Add more machine testsAshley Cui2022-05-10
| |/ | | | | | | | | | | Add more machine tests for flags in init, inspect, and list. Signed-off-by: Ashley Cui <acui@redhat.com>
* / kube: add support for --userns=Giuseppe Scrivano2022-05-10
|/ | | | | | | | add support to override the user namespace to use for the pod. Closes: https://github.com/containers/podman/issues/7504 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* build: disable --output for podman-remote clientsAditya R2022-05-05
| | | | | | | | | Disable `build --output` for remote clients and update docs. [NO NEW TESTS NEEDED] [NO TESTS NEEDED] Signed-off-by: Aditya R <arajan@redhat.com>
* Vendor in containers/buildah@v1.26.1Daniel J Walsh2022-05-05
| | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #14037 from rhatdan/remoteuriOpenShift Merge Robot2022-05-04
|\ | | | | Report correct RemoteURI
| * Report correct RemoteURIDaniel J Walsh2022-05-04
| | | | | | | | | | | | | | | | | | | | | | | | Rather than assuming a filesystem path, the API service URI is recorded in the libpod runtime configuration and then reported as requested. Note: All schemes other than "unix" are hard-coded to report URI exists. Fixes #12023 Signed-off-by: Jhon Honce <jhonce@redhat.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Merge pull request #14066 from ashley-cui/sysresOpenShift Merge Robot2022-05-04
|\ \ | |/ |/| podman system reset removed machines incorrectly
| * podman system reset removed machines incorrectlyAshley Cui2022-05-04
| | | | | | | | | | | | | | podman system reset did not clean up machines fully, leaving some config files, and breaking machines. Now it removes all machines files fully. Signed-off-by: Ashley Cui <acui@redhat.com>
* | Merge pull request #14060 from nicrowe00/13781OpenShift Merge Robot2022-05-04
|\ \ | | | | | | play kube default log driver
| * | play kube default log driverNiall Crowe2022-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | The default log driver is not used when using play kube without --log-driver. The LogDriver function needs to be called in order to use the default log driver. fixes #13781 Signed-off-by: Niall Crowe <nicrowe@redhat.com>
* | | machine events: only open sockets when neededPaul Holzinger2022-05-04
| | | | | | | | | | | | | | | | | | | | | | | | We should only open the socket when needed and not always at init time. [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | Merge pull request #14099 from jwhonce/wip/machine_inspectOpenShift Merge Robot2022-05-04
|\ \ \ | |/ / |/| | Implement --format for machine inspect
| * | Implement --format for machine inspectJhon Honce2022-05-03
| |/ | | | | | | | | | | * Fix issue of nil pointer derefence Signed-off-by: Jhon Honce <jhonce@redhat.com>
* / Add podman machine eventsJhon Honce2022-05-03
|/ | | | Signed-off-by: Jhon Honce <jhonce@redhat.com>
* pod: add exit policiesValentin Rothberg2022-05-02
| | | | | | | | | | | | | | | | | | | | | | | | Add the notion of an "exit policy" to a pod. This policy controls the behaviour when the last container of pod exits. Initially, there are two policies: - "continue" : the pod continues running. This is the default policy when creating a pod. - "stop" : stop the pod when the last container exits. This is the default behaviour for `play kube`. In order to implement the deferred stop of a pod, add a worker queue to the libpod runtime. The queue will pick up work items and in this case helps resolve dead locks that would otherwise occur if we attempted to stop a pod during container cleanup. Note that the default restart policy of `play kube` is "Always". Hence, in order to really solve #13464, the YAML files must set a custom restart policy; the tests use "OnFailure". Fixes: #13464 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* Merge pull request #14026 from n1hility/simulate-dualstackOpenShift Merge Robot2022-04-30
|\ | | | | Use simulated dual-stack binds when using WSL
| * Use simulated dual-stack binds when using WSLJason T. Greene2022-04-29
| | | | | | | | | | | | Resolves a WSL problem where traffic from only one stack is relayed Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
* | enable errcheck linterPaul Holzinger2022-04-29
| | | | | | | | | | | | | | | | The errcheck linter makes sure that errors are always check and not ignored by accident. It spotted a lot of unchecked errors, mostly in the tests but also some real problem in the code. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | Merge pull request #14033 from baude/inspectredoOpenShift Merge Robot2022-04-28
|\ \ | | | | | | Refactor machine inspect
| * | Refactor machine inspectBrent Baude2022-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was asked to refactor machine inspect output to represent more common and basic information. machine inspect now has information that would be appropriate for different machines. [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
* | | image search --format: add completion for go templatePaul Holzinger2022-04-28
| | | | | | | | | | | | | | | | | | | | | podman image search accepts a go template, we can use the same shell completion logic which is used everywhere else in the code. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | shell completion --format: use structs by referencePaul Holzinger2022-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the AutocompleteFormat function we expect the correct template struct which is used in the golang template. The function can handle both struct and pointer to a struct. Using the reference is more efficient since it doe snot have to copy the whole struct. Also change some structs to use he actual type from the template instead of some nested one to make sure it has to correct fields. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | image --format: fix add completion for go templatePaul Holzinger2022-04-28
| | | | | | | | | | | | | | | | | | | | | | | | It used the wrong struct so not all fields were listed in the completion. Fixes podman images --format and podman image history --format Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | shell completion --format: use anonymous struct field oncePaul Holzinger2022-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should not include the anonymous twice in the suggestions. one example is `podman network ls --format {{.` it will also show `{{.Network` but since Network is the actual struct all fields are already shown so there is no need for it to be suggested. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | network inspect --format: add completion for go templatePaul Holzinger2022-04-28
| | | | | | | | | | | | | | | | | | Make sure to autocomplete the go template for network inspect. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | | shell completion --format: work with nil structsPaul Holzinger2022-04-28
|/ / | | | | | | | | | | | | | | | | | | | | | | | | AutocompleteFormat() takes the format struct as argument. Often the structs are deeply nested and contain other structs. Up until now if there was a pointer to a struct the logic was not able to get the field names from that, simply because the pointer was nil. However it is possible to create a new initialized type with reflect.New(). This allows us to complete all struct fields/functions even when there nil pointers. Therefore we can drop the extra initialization which was done by some callers. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman search: truncate by defaultValentin Rothberg2022-04-28
| | | | | | | | | | | | | | | | | | | | Truncate by default to avoid long descriptions from rendering the output unreadable. [NO NEW TESTS NEEDED] Fixes: #14044 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | Merge pull request #14034 from rhatdan/historyOpenShift Merge Robot2022-04-27
|\ \ | | | | | | Add CreatedSince & CreatedAt format fields to podman image history
| * | Add CreatedSince & CreatedAt format fields to podman image historyDaniel J Walsh2022-04-27
| | | | | | | | | | | | | | | | | | Fixes: https://github.com/containers/podman/issues/14012 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | Merge pull request #13953 from ashley-cui/machOpenShift Merge Robot2022-04-27
|\ \ \ | |/ / |/| | Allow changing of CPUs, Memory, and Disk Size
| * | Allow changing of CPUs, Memory, and Disk SizeAshley Cui2022-04-27
| |/ | | | | | | | | | | | | | | | | Allow podman machine set to change CPUs, Memory and Disk size of a QEMU machine after its been created. Disk size can only be increased. If one setting fails to be changed, the other settings will still be applied. Signed-off-by: Ashley Cui <acui@redhat.com>
* | Merge pull request #14023 from rhatdan/kubeOpenShift Merge Robot2022-04-27
|\ \ | | | | | | Truncate annotations when generating kubernetes yaml files
| * | Truncate annotations when generating kubernetes yaml filesDaniel J Walsh2022-04-27
| |/ | | | | | | | | | | | | | | | | | | | | | | Kubernetes only allows 63 characters in an annotation. Make sure that we only add 63 or less charaters when generating kube. Warn if containers or pods have longer length and truncate. Discussion: https://github.com/containers/podman/discussions/13901 Fixes: https://github.com/containers/podman/issues/13962 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* / enable gocritic linterPaul Holzinger2022-04-26
|/ | | | | | | | | | | | | | | | | | | | | | The linter ensures a common code style. - use switch/case instead of else if - use if instead of switch/case for single case statement - add space between comment and text - detect the use of defer with os.Exit() - use short form var += "..." instead of var = var + "..." - detect problems with append() ``` newSlice := append(orgSlice, val) ``` This could lead to nasty bugs because the orgSlice will be changed in place if it has enough capacity too hold the new elements. Thus we newSlice might not be a copy. Of course most of the changes are just cosmetic and do not cause any logic errors but I think it is a good idea to enforce a common style. This should help maintainability. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* [CI:DOCS]Remove unnecesarry filesBrent Baude2022-04-26
| | | | | | | | | Removing two files that are not needed. One is likely an accidental check-in and the other is a empty file. [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
* Merge pull request #13996 from cdoern/machineOpenShift Merge Robot2022-04-26
|\ | | | | machine starting status
| * machine starting statuscdoern2022-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | podman machine was using the file modification time to get the running status add three new config entries Starting (bool) Created (time) LastUp (time) to actually keep track of when these events happened. This means we can use the config file to actually store this data and not mess up the created/last-up time. This fixes the issues where the machine would report running 15 seconds before it was up. Also fixes the issue of modifying the file manually and saying the machine is "up" [NO NEW TESTS NEEDED] resolves #13711 Signed-off-by: cdoern <cbdoer23@g.holycross.edu>