32 Commits

Author SHA1 Message Date
20523152f8 Add "create" and "remove" events for secrets.
This commit adds the "secret" Event type and emits
"create" and "remove" events for this Event type
when Secret is created or removed.

This can be used for example by podman interfaces to
view and manage secrets.

Fixes: #24030

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2025-02-28 16:58:06 +01:00
be3f075402 Make podman update changes persistent
The logic here is more complex than I would like, largely due to
the behavior of `podman inspect` for running containers. When a
container is running, `podman inspect` will source as much as
possible from the OCI spec used to run that container, to grab
up-to-date information on things like devices. We don't want to
change this, it's definitely the right behavior, but it does make
updating a running container inconvenient: we have to rewrite the
OCI spec as part of the update to make sure that `podman inspect`
will read the correct resource limits.

Also, make update emit events. Docker does it, we should as well.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-17 08:23:50 -04:00
9ee96a9569 properly implement pull-error event status
Commit 03f6589f3 added basic support for pull-error event from libimage
but it contains several problems:
1. storing the error as error type prevents it from being unmarshalled,
   thus change it to a string
2. the error was never propagated from the libimage event to the podman
   event struct
3. the error message was not wired into the cli and API

This commit fixes these problems.

Fixes #21458

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-03-05 10:50:42 +01:00
8f1cebf96f cmd/podman: remove duplicated event ToHumanReadable()
ToHumanReadable() exists twice now, there is no reason for this just
call the function on the backend event type is fine as this still has to
be used there.

It also fixes a bug where the wrong event type was passed to the
template which did not match the docs and json output.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-02-22 12:10:57 +01:00
a3a1b44c31 libpod/events: Update event time format and add timeNano
Add new event type in cmd/podman to better match the docker format.

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-02-22 11:32:48 +01:00
9d73dc6ed0 Apply suggestions from code review
Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-02-19 15:40:09 -05:00
4e268c667a Fix up example description of podman-events.1.md
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-02-18 08:07:13 -05:00
dbe0e67897 Man pages: tighter documenting of --format fields
Initial impetus was #20958 (ps --format .Label abc). This is
a complicated solution to a simple-seeming problem.

The problem: .Label is a cobra *function*, something I did not
know about nor handle.

Solution: recognize cobra functions. Switch to __complete,
not __completeNoDesc, so we can see the number of arguments
required. Invent new man-page format for documenting functions.
And, finally, start enforcing how functions (and cobra structs)
are documented.

This discovered a never-used completion function, .Recycle(),
in podman-events. Remove it.

[NO NEW TESTS NEEDED] - the .go change is an excision of dead code.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-01-15 13:11:27 -07:00
deba3b80a1 man page crossrefs: add --filter autocompletes
For all commands with a --filter option, cross-reference
against man pages, and vice-versa.

I'm sorry. I know this script has gone off the deep end.

[NO NEW TESTS NEEDED] although actually I would like to test some broken completions

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-09-17 06:20:33 -06:00
32c2cea0f9 Remove future tense from man pages
Remove all will, would, could, should and use present tense.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-16 15:10:33 -04:00
64ea5971a1 *: migrate image registry to registry.k8s.io
This change is a part of the bigger umbrella issue: https://github.com/kubernetes/k8s.io/issues/4780
Currently, we need this change to get in https://github.com/cri-o/cri-o/pull/6742,
which is failing in CI due to inconsistent vendoring.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
2023-04-11 10:30:43 -04:00
4562e61d20 podman events: unhide --stream
The --stream flag is being used extensively in the tests and some blog
posts refer to it which has been causing some confusion on why the flag
was hidden.  I do not see a good reason to hide it anymore, so unhide it
and add some docs.

[NO NEW TESTS NEEDED] as it's already being tested.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-14 11:26:50 +01:00
4334135491 [CI:DOCS] man-page checker: include --format (Go templates)
Very belated successor to #14046.

I don't know why this is so important to me. Probably because we're
doing a halfhearted sloppy job of documenting, and new options get
added, and not documented, and that's just wrong.

I've given up on documenting internal structs. This iteration
has a $Format_Exceptions table defined at the top of the xref
script, enumerating a hardcoded defined set of podman commands
and fields that should remain undocumented.

This iteration also forgives completely-undocumented formats.
If podman-foo has a --format, but podman-foo.1.md does not
list *any* valid fields, the script warns but does not fail.
This at least is better than documenting a random mix of fields.

This version of the xref script is much slower: 10s vs 4. I
think we can live with that in a CI-only script.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-08 15:33:45 -07:00
1fd0ce71d0 [CI:DOCS] events: document journald identifiers
Document the identifiers used in the journald events backend. Those can
be used to filter Podman events with journalctl and I need them to be
documented for a blog I am writing at the moment.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-07 13:56:43 +01:00
8f2a40d814 [DOCS:CI] podman-events: document verbose create events
issues.redhat.com/browse/RHELBU-1918 is mentioning the podman-events man
page which are lacking notes on the verbose create events added by
commit 71f92d263c7f.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-30 09:37:03 +01:00
45b180c1f8 events: support "die" filter
Map "die" to the "died" status for Docker compat.

Fixes: #16857
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-12-22 10:59:40 +01:00
bc77c034f8 Add podman system events alias to podman events
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-11 12:57:49 -05:00
6790deb1b1 man pages: document some --format options
Baby steps toward merging #14046: document Go format options
for podman events.

This is deliberately imperfect. I am not the right person
to document these. I am simply the person who is getting
a skeleton framework in place.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-09-19 08:34:38 -06:00
63c779a857 Fix manpage headers
Signed-off-by: Andrew Denton <adenton@redhat.com>
2022-09-06 09:37:13 -07:00
cc2cfe0602 Add podman events -f to be alias for --filter
Needed for Docker compatibility.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-13 10:55:27 -04:00
a2077e5eae Add missing events to podman-events man page
[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-04-19 16:30:26 -04:00
9b0c8d23bd man pages: sort flags, and keep them that way
Command flags (OPTIONS) in man pages have to date been in
haphazard order. Sometimes that order is sensible, e.g.,
most-important options first, but more often they're
just in arbitrary places. This makes life hard for users.

Here, I update the man-page-check Makefile script so it
checks and enforces alphabetical order in OPTIONS sections.
Then -- the hard part -- update all existing man pages to
conform to this requirement.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-03-23 13:49:42 -06:00
2720156fa5 Add links to all SEE ALSO sections
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-10 09:29:21 -05:00
4216f7b7f4 Add no-trunc support to podman-events
Standardize on no-trunc through the code.
Alias notruncate where necessary.

Standardize on the man page display of no-trunc.

Fixes: https://github.com/containers/podman/issues/8941

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-16 09:41:29 -04:00
30e731ecc8 Revert escaped double dash man page flag syntax
Commit 800a2e2d35 introduced a way to disable the conversion of `--`into
an en dash on docs.podman.io, so the ugly workaround of escaping the
dashes is no longer necessary.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-05-07 18:30:00 +02:00
bc48211924 Fix long option format on docs.podman.io
Escape the two dashes, otherwise they are combined into one long dash.
I tested that this change is safe and still renders correctly on github
and with the man pages.

This commit also contains a small change to make it build locally.
Assuming you have the dependencies installed you can do:
```
cd docs
make html
```
Preview the html files in docs/build/html with
`python -m http.server 8000 --directory build/html`.

Fixes containers/podman.io#373

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-03-29 14:38:25 +02:00
52a8694705 Add anchors for flag names on docs.podman.io
Change the docs markdown so that flag names will be h4 headers.
Sphinx will automatically add anchors to headers. Add css to
make sure the flag names are not to big compared to the text.

The man pages also still renders fine but it looks a bit different.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-10 15:27:08 +01:00
c593e49701 filter events by labels
adding the ability to filter evens by the container labels.  this requires that container labels be added to the events data being recorded and subsequently read.

Signed-off-by: baude <bbaude@redhat.com>
2020-10-23 12:07:34 -05:00
841eac0af6 Switch references from libpod.conf to containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-20 15:09:54 -04:00
99cbe59917 podman-events: clarify streaming behaviour
Unless `--since` or `--until` is specified, `podman events` will stream
new events.  Clarify this behavior in the `--help` message and man page
to avoid confusion.

Fixes: #6536
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-10 11:09:12 +02:00
28ffe74e44 fix bug --format {{json.}} of events
Allow the `podman events --format` accept {{json.}} and complete small fix podman-events.1.md

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-14 14:28:51 -04:00
486fcd4e1e Update document formatting and packaging code
* Refactored code and Makefile to support new docs layout
* Removed some old code packaging code
* Add Readme.md to document what we're doing

Signed-off-by: Jhon Honce <jhonce@redhat.com>
Signed-off-by: baude <bbaude@redhat.com>
2019-10-31 12:31:39 -05:00