-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Podman inspect completion #19261
Podman inspect completion #19261
Conversation
Obviosly this does not handle the case where there are duplicate names, but we already have the problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual code LGTM, can you please squash the commits into one. We try to keep a clean git history and unless there is a good reason to use several commits, i.e. when making several distinct changes, we prefer one commit per feature including the tests.
run
git rebase -i HEAD~4
then select change pick
to s
for the last three commits.
Also I recommend to reword the commit messsage. The title should be shorter, I suggest something like: add completion for podman inspect --format
. Note this go code is used by all shell completion scripts so focusing on bash is not correct. This will make it work for all supported shells.
You can change the message of the latest commit with: git commit --amend
If you need any help with these git commands let me know.
test/system/README.md
Outdated
- The `jq` tool is needed for parsing JSON output. | ||
- The `bats` tool is needed for running tests. | ||
- The `skopeo` tool is needed for fetching remote images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are more requirements, https://github.com/containers/podman/blob/c6f8de8a457800dfa3fb1fe7047f05f2fed34ebc/rpm/podman.spec#L142-L154C16
And if I learned one thing we are very bad at keeping these up to date. I think it would make more sense to just say the latest requirements are listed in the podman-tests rpm. We can add this command: dnf repoquery --requires podman-tests
, this way we do not have to update the list here
cc @edsantiago
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what @Luap99 meant here was that you add something like "see rpm/podman.spec, under 'package test', for a list of requirements". Duplicating the list here is unmaintainable. Too late, though; we'll have to deal with that another day.
Nice work otherwise!
3088c61
to
35a5d5b
Compare
35a5d5b
to
f9340ec
Compare
You also have to add: diff --git a/test/system/610-format.bats b/test/system/610-format.bats
index 3ee95bdff..d22f3924b 100644
--- a/test/system/610-format.bats
+++ b/test/system/610-format.bats
@@ -25,6 +25,7 @@ history | $IMAGE
image history | $IMAGE
image inspect | $IMAGE
container inspect | mycontainer
+inspect | mycontainer
volume inspect | -a
secret inspect | mysecret This fixes the system tests because we know complete go template for podman inspect. |
Signed-off-by: Chetan Giradkar <[email protected]>
f9340ec
to
00a5b07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@containers/podman-maintainers PTAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Nice work!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgiradkar, Luap99, vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add tab-completion feature for podman inspect -f
The command:
podman inspect <ContainerID> -f "{{."
was not giving any output in console for bash-completion but the same was working fine for the command:
podman container inspect <ContainerID> -f "{{."
So added a flow to handle the former command and additionally handled all types of entities namely container, image, volume, pod and network.
This would ESSENTIALLY make the sub-commands such as follows OBSOLETE:
podman container inspect
podman image inspect
podman volume inspect
podman pod inspect
podman network inspect
Does this PR introduce a user-facing change?
Closes #18672
Signed-off-by: Chetan Giradkar [email protected]