75 Commits

Author SHA1 Message Date
72f1617fac Bump Go module to v5
Moving from Go module v4 to v5 prepares us for public releases.

Move done using gomove [1] as with the v3 and v4 moves.

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

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-08 09:35:39 -05:00
2a2d0b0e18 chore: delete obsolete // +build lines
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-04 11:53:38 +02:00
478afa728d vendor: update containers/{common,storage,image,buildah}
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-11-21 21:04:47 +01:00
dd8f57a3b4 Add podman farm build command
Add podman farm build command that sends out builds to
nodes defined in the farm, builds the images on the farm
nodes, and pulls them back to the local machine to create
a manifest list.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-10-24 12:58:39 -04:00
bad25da92e libpod: add !remote tag
This should never be pulled into the remote client.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-24 12:11:34 +02:00
73dc72f80d vendor of containers/common
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-09-20 08:39:49 -04:00
ac212605c9 Remove any quotes around distribution id
Some distributions add extra quotes, even to fields like ID
that doesn't really need them. Make sure to remove them too.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2023-07-24 19:53:34 +02:00
6f821634ad libpod: Podman info output more network information
podman info prints the network information about binary path,
package version, program version and DNS information.

Fixes: #18443

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-06-13 11:19:29 +09:00
1013696ad2 Add number of free locks to podman info
This is a nice quality-of-life change that should help to debug
situations where someone runs out of locks (usually when a bunch
of unused volumes accumulate).

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-06-05 14:00:40 -04:00
685c736185 source code comments and docs: fix typos, language, Markdown layout
- fix a/an before noun
- fix loose -> lose
- fix "the the"
- fix lets -> let's
- fix Markdown layout
- fix a few typos
- remove unnecessary text in troubleshooting.md

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-05-22 07:52:16 +02:00
e77f370f86 sqlite: add a hidden --db-backend flag
Add a hidden flag to set the database backend and plumb it into
podman-info.  Further add a system test to make sure the flag and the
info output are working properly.

Note that the test may need to be changed once we settled on how
to test the sqlite backend in CI.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-02 13:43:11 +01:00
25d9af8f42 runtime: Handle the transient store options
This handles the transient store options from the container/storage
configuration in the runtime/engine.

Changes are:
 * Print transient store status in `podman info`
 * Print transient store status in runtime debug output
 * Add --transient-store argument to override config option
 * Propagate config state to conmon cleanup args so the callback podman
   gets the same config.

Note: This doesn't really change any behaviour yet (other than the changes
in containers/storage).

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-12-05 18:09:21 +01:00
2c63b8439b Fix stutters
Podman adds an Error: to every error message.  So starting an error
message with "error" ends up being reported to the user as

Error: error ...

This patch removes the stutter.

Also ioutil.ReadFile errors report the Path, so wrapping the err message
with the path causes a stutter.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-10 07:52:00 -04:00
b0700aa482 libpod: Enable 'podman info' for FreeBSD
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-24 10:55:52 +01:00
ff20c74e97 libpod: Move getCPUUtilization to info_linux.go
The Linux implementation uses /proc/stat - the FreeBSD equivalent is
quite different where this information is exposed via sysctl.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-24 10:55:52 +01:00
694cbaca37 libpod: Read kernel version and uptime using buildah/pkg/util
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-24 10:55:52 +01:00
877e673992 libpod: Split out platform-specific code from hostInfo
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-24 10:55:49 +01:00
1b88927c2c libpod: Add stubs for non-linux builds
Note: this makes info.go linux-only since it mixes linux-specific and
generic code. This should be addressed in a separate refactoring PR.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-17 11:45:07 +01:00
251d91699d libpod: switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.

[NO NEW TESTS NEEDED]

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-05 16:06:32 +02:00
e13c5f3a9e Refactor populating uptime
Refactor populating uptime field to use standard library parsing and
math for populating the hour, minute, seconds fields.

Note: the go-humanize package does not cover time.Duration just
time.time.

```release-note
NONE
```

[NO NEW TESTS NEEDED]

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2022-05-26 15:46:04 -07:00
5b2d5c365b Robust whitespace split of cpu utilization line from /proc/stat
Signed-off-by: Sandro Casagrande <sc.casagrande@gmail.com>
2022-05-14 00:34:56 +00:00
0bb4849377 Additional stats for podman info
In support of podman machine and its counterpart desktop, we have added
new stats to podman info.

For storage, we have added GraphRootAllocated and GraphRootUsed in
bytes.

For CPUs, we have added user, system, and idle percents based on
/proc/stat.

Fixes: #13876

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-05-03 07:11:07 -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
a15dfb3648 Standardize on capatalized Cgroups
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-14 12:30:20 -05:00
2130d18539 Update vendor or containers/common moving pkg/cgroups there
[NO NEW TESTS NEEDED] This is just moving pkg/cgroups out so
existing tests should be fine.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-07 06:17:11 -05:00
8041d44c93 Add network backend to podman info
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-11 16:49:46 +01:00
d7662edf66 [NO NEW TESTS NEEDED] Fix off-by-one index comparision (reported by LGTM)
LGTM alert:

    Off-by-one index comparison against length may lead to out-of-bounds read.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-10-25 10:52:01 +02:00
1c4e6d8624 standardize logrus messages to upper case
Remove ERROR: Error stutter from logrus messages also.

[ NO TESTS NEEDED] This is just code cleanup.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-22 15:29:34 -04:00
5f41ffdd19 Merge pull request #11322 from Luap99/network-libpod
Wire network interface into libpod
2021-09-15 16:11:14 -04:00
5e8309464a Add Drivers method to the Network Interface
Drivers should return the list of supported network drivers by this
plugin. This is useful for podman info.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-15 20:00:28 +02: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
3e77f960f6 Set default storage from containers.conf for temporary images
Fixes: https://github.com/containers/podman/issues/11107

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-15 10:43:51 -04:00
38c5f6721f Show variant and codename of the distribution
Along with the name (id) and the version(_id)

But only show the information if is available

Examples: Fedora CoreOS, Ubuntu Focal

[NO TESTS NEEDED]

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-09-14 17:44:42 +02:00
2f967b81cb Add logDriver to podman info
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-08 17:53:04 -04:00
16dfce486b Podman info output plugin information
For docker compat include information about available volume, log and
network drivers which should be listed under the plugins key.

Fixes #11265

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-08-19 17:33:20 +02:00
1adeb2b70f podman info show correct slirp4netns path
The slirp4netns path can be set in the config file or with
--network-cmd-path. Podman info should read the version information
correctly and not use PATH in this case. Also show the slirp4netns
version information to root users.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-08-09 12:59:28 +02:00
f95b0995e5 remove pkg/registries
Pull the trigger on the `pkg/registries` package which acted as a proxy
for `c/image/pkg/sysregistriesv2`.  Callers should be using the packages
from c/image directly, if needed at all.

Also make use of libimage's SystemContext() method which returns a copy
of a system context, further reducing the risk of unintentionally
altering global data.

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-25 09:56:21 +02:00
2f5552c32d Podman info add support for status of cgroup controllers
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2021-05-24 16:55:23 +05:30
18cb17ffeb Use seccomp_profile as default profile if defined in containers.conf
Edits `podman info` to provide the default seccomp profile
detected in the output

Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
2021-04-28 15:19:48 +02: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
69ab67bf90 Enable golint linter
Use the golint linter and fix the reported problems.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-11 23:01:49 +01:00
04b43ccf64 Add Security information to podman info
When debugging issues, it would be helpful to know the
security settings of the system running into the problem.
Adding security info to `podman info` is also useful to users.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-22 08:13:14 -05:00
f00cc25a7c Drop default log-level from error to warn
Our users are missing certain warning messages that would
make debugging issues with Podman easier.

For example if you do a podman build with a Containerfile
that contains the SHELL directive, the Derective is silently
ignored.

If you run with the log-level warn you get a warning message explainging
what happened.

$ podman build --no-cache -f /tmp/Containerfile1 /tmp/
STEP 1: FROM ubi8
STEP 2: SHELL ["/bin/bash", "-c"]
STEP 3: COMMIT
--> 7a207be102a
7a207be102aa8993eceb32802e6ceb9d2603ceed9dee0fee341df63e6300882e

$ podman --log-level=warn build --no-cache -f /tmp/Containerfile1 /tmp/
STEP 1: FROM ubi8
STEP 2: SHELL ["/bin/bash", "-c"]
STEP 3: COMMIT
WARN[0000] SHELL is not supported for OCI image format, [/bin/bash -c] will be ignored. Must use `docker` format
--> 7bd96fd25b9
7bd96fd25b9f755d8a045e31187e406cf889dcf3799357ec906e90767613e95f

These messages will no longer be lost, when we default to WARNing level.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-03 06:28:09 -05:00
99386c7ae7 Include cgroup manager in podman info output
This is very useful for debugging cgroups v2, especially on
rootless - we need to ensure people are correctly using systemd
cgroups in these cases.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-09-22 13:15:01 -04:00
526f01cdf5 Fix up errors found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-11 06:14:25 -04: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
c21258b70e Add podman static build
We’re now able to build a static podman binary based on a custom nix
derivation. This is integrated in cirrus as well, whereas a later target
would be to provide a self-contained static binary bundle which can be
installed on any Linux x64-bit system.

Fixes: https://github.com/containers/libpod/issues/1399

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-05-11 13:11:07 +02:00
ad27532b6c Eliminate race condition on podman info
There is a potential of a race condition where
a container is removed while podman is looking
up information on the total containers.  This can
cause podman info to fail with an error
"no such container".

This change ignores the failure.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-05 13:33:41 -04:00
62803f8d3b Add version to podman info command
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-15 21:30:56 -04:00