Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--no-trunc options is needed for Podman events #8941

Closed
PavelSosin-320 opened this issue Jan 12, 2021 · 14 comments · Fixed by #11603
Closed

--no-trunc options is needed for Podman events #8941

PavelSosin-320 opened this issue Jan 12, 2021 · 14 comments · Fixed by #11603
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@PavelSosin-320
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature
Description
--no-trunc options is needed for Podman events command to avoid Pod state monitoring complexity

##8930

Podman events command always emits the long object ID unlike other Podman commands like Podman pod ls, It lacs --no-trunc option to request either short or long ID in the event data.
When using Podman Pod create, ls without --no-trunc option and then /stop, start commands The Pod id in the event data never matches the ID used in the command never matches the long ID in the event data.
In the interactive mode, it creates the impression that pod and its container status are changed in the chaotic order and never match the podman pod ls command results. The default ID format in the Podman ls commands is short ID. The default Podman pod events ID format is long ID.
It creates redundant complexity in programmatic interface implementation because Event's observer has to keep ShortID - Long ID mapping at the client-side and passes --no-trunc option in the right context.

The Podman events --no-trunc option with the default value false will allow a more simple way to match action commands parameters, list commands parameters and Events stream data.

Steps to reproduce the issue:

  1. Start event listening Podman events type=pod
  2. Create a single container pod using --pod new: option podname
  3. List pods using podman pod ls without --no-trunc to get short ID
  4. Stop pod using short ID
  5. Start pod using short ID
  6. List pods again
  7. List containers and their states running in the Pod.

Describe the results you received:
Stream of events containing long pod ID, "image", (???)
The pod is got from pod ls and used in the start / stop commands never appears.
An arbitrary number of events of unknown objects state changes.

Describe the results you expected:
I would like to select short / long ID format in the event data using --no-trunc option

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

(paste your output here)

Output of podman info --debug:

(paste your output here)

Package info (e.g. output of rpm -q podman or apt list podman):

(paste your output here)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes/No

Additional environment details (AWS, VirtualBox, physical, etc.):

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 12, 2021
@mheon
Copy link
Member

mheon commented Jan 12, 2021

I don't think we can make --no-trunc the default going forward - that would be a breaking change in established functionality. We can add an option to truncate IDs, but it would have to be enabled by a new flag and it cannot be the default.

@rhatdan
Copy link
Member

rhatdan commented Jan 12, 2021

Well add --no-trunk and default it to true.

@PavelSosin-320
Copy link
Author

But other "display" command use --no-trunc options and truncate ID by default - see podman pod ls:
podman pod ls --help
List pods

Description:
List all pods on system including their names, ids and current state.

--no-trunc Do not truncate pod and container IDs

podman pod ls
POD ID NAME STATUS CREATED # OF CONTAINERS INFRA ID
1e666b1daefd devcontainerShare Created 8 hours ago 3 50caae355f77

but pod --no-trunc ls
Error: unknown flag: --no-trunc

But Podman list has --no-trunc flag and
podman pod list
POD ID NAME STATUS CREATED # OF CONTAINERS INFRA ID
1e666b1daefd devcontainerShare
podman pod list --no-trunc
POD ID NAME STATUS CREATED # OF CONTAINERS INFRA ID
1e666b1daefd9d5cc0bb7243ad9fbf39d6aeaad603ebd0cf361f70553fdd73c3 devcontainerShare

P.S.

Either Podman event or Podman Pod ls --no-trunc command has a bug or both.

Pod inspect shows podman pod inspect devcontainerShare
{
"Id": "1e666b1daefd9d5cc0bb7243ad9fbf39d6aeaad603ebd0cf361f70553fdd73c3",
"Name": "devcontainerShare",

CgroupPath": "machine.slice/machine-libpod_pod_1e666b1daefd9d5cc0bb7243ad9fbf39d6aeaad603ebd0cf361f70553fdd73c3.slice.

In the current situation Podman event command is not usable. There is no way to track Pod state neither by events no by list.

P.S. podman events --filter type=pod,name=devcontainerShare works but shows
1e666b1daefd9d5cc0bb7243ad9fbf39d6aeaad603ebd0cf361f70553fdd73c3 (image=, name=devcontainerShare)

@TomSweeneyRedHat
Copy link
Member

can you add a better description for historical purposes and repush please?

@TomSweeneyRedHat
Copy link
Member

@PavelSosin-320, see previous reply.

@TomSweeneyRedHat TomSweeneyRedHat changed the title PR: --no-trunc options is needed for Podman events Jan 12, 2021
@TomSweeneyRedHat
Copy link
Member

@PavelSosin-320 Ooops, never mind, I saw the PR in the title and thought it was a PR. I've edited the title of this issue.

@mheon
Copy link
Member

mheon commented Jan 12, 2021

@PavelSosin-320 I don't see how it's unusable - short and long IDs are completely interchangeable in all Podman commands. I am definitely not opposed to adding the ability for podman events to use short IDs, but doing so by default is a breaking change, and we can only make those when we absolutely have to to avoid breaking existing users.

@PavelSosin-320
Copy link
Author

PavelSosin-320 commented Jan 13, 2021 via email

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@baude
Copy link
Member

baude commented Jul 6, 2021

@PavelSosin-320 any chance you can log onto libera #podman and we could discuss this? I want to make sure I have a better understanding of what you are asking for ... right now, I think you just want want the ctr id to be the short id by default and add a --no-trunc option that shows the full id. What I don't quite grasp is why ... this helps us write tests and implement the feature properly.

@github-actions
Copy link

github-actions bot commented Aug 6, 2021

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Aug 6, 2021

@baude @PavelSosin-320 Did this ever get resolved?

@vrothberg
Copy link
Member

Since we're targeting 4.0, I think it's a good moment to make this change. Add a --no-trunc (default: false). I think it's unlikely to break existing users since the JSON output shouldn't truncate.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

rhatdan added a commit to rhatdan/podman that referenced this issue Sep 16, 2021
Standardize on no-trunc through the code.
Alias notruncate where necessary.

Standardize on the man page display of no-trunc.

Fixes: containers#8941

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants