15 Commits

Author SHA1 Message Date
b9a2d8698a Handlers for generate systemd with custom dependencies
This commit includes:
* Handlers for generate systemd unit
  with manually defined dependencies such as:
  Wants=, After= and Requires=

* The new unit and e2e tests for checking generated systemd units
  for container and pod with custom dependencies

* Documented descriptions for custom dependencies options

Signed-off-by: Eugene (Evgenii) Shubin <esendjer@gmail.com>
2022-01-19 21:46:16 +05:00
bd09b7aa79 bump go module to version 4
Automated for .go files via gomove [1]:
`gomove github.com/containers/podman/v3 github.com/containers/podman/v4`

Remaining files via vgrep [2]:
`vgrep github.com/containers/podman/v3`

[1] https://github.com/KSubedi/gomove
[2] https://github.com/vrothberg/vgrep

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2022-01-18 12:47:07 +01:00
c9ad1da51c Add restart-sec option to systemd generate
Signed-off-by: Ondra Machacek <omachace@redhat.com>
2021-12-03 12:11:28 +01:00
566b78dd02 generate systemd: add --start-timeout flag
Add a new flag to set the start timeout for a generated systemd unit.
To make naming consistent, add a new --stop-timeout flag as well and let
the previous --time map to it.

Fixes: #11618
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-23 09:38:51 +01:00
ece0c7e5d3 Support template unit files in podman generate systemd
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2021-10-22 04:19:18 +03:00
deaf969243 Refacter API server emphasis on logging
* To aid in debugging log API request and response bodies at trace
  level. Events can be correlated using the X-Reference-Id.
* Server now echos X-Reference-Id from client if set, otherwise
  generates an unique id.
* Move logic for X-Reference-Id into middleware
* Change uses of Header.Add() to Set() when setting Content-Type
* Log API operations in Apache format using gorilla middleware
* Port server code to use BaseContext and ConnContext

Fixes #10053

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-09-10 15:07:25 -07:00
d1573b95e3 generate systemd: handle --restart
Handle custom restart policies of containers when generating the unit
files; those should be set on the unit level and removed from ExecStart
flags.

Fixes: #11438
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-07 13:58:11 +02:00
a6e7d19c46 Merge pull request #9445 from jmguzik/no-header-info-for-systemd-generation
No header info for systemd generation
2021-02-22 13:44:43 -05:00
d2f3098c6f --no-header flag implementation for generate systemd
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-02-22 14:48:33 +01:00
5dded6fae7 bump go module to v3
We missed bumping the go module, so let's do it now :)

* Automated go code with github.com/sirkon/go-imports-rename
* Manually via `vgrep podman/v2` the rest

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-22 09:03:51 +01:00
749ee2a10e generate kube on multiple containers
add the ability to add multiple containers into a single k8s pod
instead of just one.

also fixed some bugs in the resulting yaml where an empty service
description was being added on error causing the k8s validation to fail.

Signed-off-by: baude <bbaude@redhat.com>
2020-12-07 11:34:39 -06:00
ebfea2f4f8 APIv2 add generate systemd endpoint
Add support for generating systemd units
via the api and podman-remote.

Change the GenerateSystemdReport type to return the
units as map[string]string with the unit name as key.

Add `--format` flag to `podman generate systemd`
to allow the output to be formatted as json.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-02 22:06:19 +02:00
a5e37ad280 Switch all references to github.com/containers/libpod -> podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-28 08:23:45 -04:00
8489dc4345 move go module to v2
With the advent of Podman 2.0.0 we crossed the magical barrier of go
modules.  While we were able to continue importing all packages inside
of the project, the project could not be vendored anymore from the
outside.

Move the go module to new major version and change all imports to
`github.com/containers/libpod/v2`.  The renaming of the imports
was done via `gomove` [1].

[1] https://github.com/KSubedi/gomove

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-06 15:50:12 +02:00
f269be3a31 add {generate,play} kube
Add the `podman generate kube` and `podman play kube` command.  The code
has largely been copied from Podman v1 but restructured to not leak the
K8s core API into the (remote) client.

Both commands are added in the same commit to allow for enabling the
tests at the same time.

Move some exports from `cmd/podman/common` to the appropriate places in
the backend to avoid circular dependencies.

Move definitions of label annotations to `libpod/define` and set the
security-opt labels in the frontend to make kube tests pass.

Implement rest endpoints, bindings and the tunnel interface.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-06 17:08:22 +02:00