21 Commits

Author SHA1 Message Date
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
495884b319 use libnetwork from c/common
The libpod/network packages were moved to c/common so that buildah can
use it as well. To prevent duplication use it in podman as well and
remove it from here.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-12 17:07:30 +01:00
46938bbf88 fix incorrect swagger doc for network dis/connect
The swagger api docs used the extra Body struct as part of the request
which is wrong. We just want the plain type.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-14 15:23:39 +01:00
85e8fbf7f3 Wire network interface into libpod
Make use of the new network interface in libpod.

This commit contains several breaking changes:
- podman network create only outputs the new network name and not file
  path.
- podman network ls shows the network driver instead of the cni version
  and plugins.
- podman network inspect outputs the new network struct and not the cni
  conflist.
- The bindings and libpod api endpoints have been changed to use the new
  network structure.

The container network status is stored in a new field in the state. The
status should be received with the new `c.getNetworkStatus`. This will
migrate the old status to the new format. Therefore old containers should
contine to work correctly in all cases even when network connect/
disconnect is used.

New features:
- podman network reload keeps the ip and mac for more than one network.
- podman container restore keeps the ip and mac for more than one
  network.
- The network create compat endpoint can now use more than one ipam
  config.

The man pages and the swagger doc are updated to reflect the latest
changes.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-15 20:00:20 +02:00
8e89d70713 [CI:DOCS] Update swagger for inspect network
struct for swagger was pointing to wrong internal type

Fixes #10559

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-06-08 15:23:46 -07:00
8378a9c4df Fix network prune api docs
The api doc used wrong response examples for both the compat and libpod
network prune endpoints. Change the doc so that it matches the actual
return values. Also fix the endpoints to return an empty array instead
of null when no networks are removed.

[NO TESTS NEEDED]

Fixes: #10564

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-08 11:38:26 +02:00
df7c3a7039 [CI:DOCS] fix incorrect network remove api doc
The endpoint returns an array and not a single entry.

Fixes #10494

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-04 14:22:52 +02:00
9b35262ca2 [CI:DOCS] Update swagger definition of inspect manifest
* Changed reference in swagger to correct struture that was being
  returned.
* Added summary to ManifestAddLibpod to clean up generated web site
* Added serve target to Makefile, to aid in debugging generated
  web site

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-04-07 09:18:23 -07:00
7b0155cf78 Fix array instead of one elem network http api
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-12 00:03:03 +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
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
cf502b99fe enable podman v2 networking for remote client
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-12 13:23:43 -05:00
37f3b191d5 Add pod prune for api v2.
Add the ability to prune pods for api v2,
Includes the addition of force flag, for client side prompt.
Update test suite to support this use case.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-04-17 17:30:58 -04:00
843fa25890 Merge pull request #5716 from baude/v2ps
podmanv2 ps
2020-04-06 22:04:16 +02:00
e20ecc733c refactor info
the current implementation of info, while typed, is very loosely done so.  we need stronger types for our apiv2 implmentation and bindings.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-06 12:45:42 -05:00
b22254dc8b podmanv2 ps
add the ability to list containers

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-06 12:12:59 -05:00
c5ce210f7d podmanv2 pod subcommands
add pod kill, pause, restart, rm, start, stop, and unpause

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-26 14:14:05 -05:00
52c8350530 serve swagger when present
register the swagger endpoint and add some error handling for when the swagger file does not exist

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-18 14:34:14 -05:00
abbbeacd68 apiv2 addition of manifests
add endpoints for create, add, remove, inspect, and push.  this allows manifests to be managed through the restful interfaces.

also added go-bindings and tests

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-16 10:03:55 -05:00
ddffc865f3 Rewire ListContainers for APIv2 libpod
consumers of the api remarked how they would prefer a more strongly typed data structure from list containers oon the libpod side of things.  for example, events should be consumable and consistent timestamps.  also, for the sake of compatibility, it is helpful to have the json named atttributes for Id to not be ID.

listcontainers on the libpod side no longer strongly uses the the ps cli to obtain information but we do benefit from turning on the ability to list the last X containers, something CLI does not have yet. we also flipped the bit on defaulting to truncated output in the return.

thanks to the efforts of the cockpit team to help us here.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-11 08:14:28 -06:00