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

podman inspect --format issues #2159

Closed
EmilienM opened this issue Jan 15, 2019 · 9 comments
Closed

podman inspect --format issues #2159

EmilienM opened this issue Jan 15, 2019 · 9 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@EmilienM
Copy link
Contributor

EmilienM commented Jan 15, 2019

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

/kind bug

Description

The podman inspect command can report empty output while in docker we had something (see example bellow).

Steps to reproduce the issue:

Runs docker inspect --format='{{range .Config.Env}} -e "{{.}}" {{end}} {{range .Mounts}} -v {{.Source}}:{{.Destination}}{{if .Mode}}:{{.Mode}}{{end}}{{end}} -ti {{.Config.Image}}' my_container

Describe the results you received:

Empty result.

Describe the results you expected:
With Docker, we had this output:

-e "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"  -e "container=oci"  -e "KOLLA_BASE_DISTRO=centos"  -e "KOLLA_INSTALL_TYPE=binary"  -e "KOLLA_INSTALL_METATYPE=rhos"  -e "PS1=$(tput bold)(
$(printenv KOLLA_SERVICE_NAME))$(tput sgr0)[$(id -un)@$(hostname -s) $(pwd)]$ "   -ti 127.0.0.1:5000/rhosp15/centos-binary-chrony:9.3.1            

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

Output of podman version:

Version:       1.0.0
Go Version:    go1.10.2
OS/Arch:       linux/amd64

Output of podman info:

host:
  BuildahVersion: 1.6-dev
  Conmon:
    package: podman-1.0.0-1.git82e8011.el7.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 1.14.0-dev, commit: 635328ab9b2058e40335533f35d595604666f1e4-dirty'
  Distribution:
    distribution: '"centos"'
    version: "7"
  MemFree: 653869056
  MemTotal: 8201072640
  OCIRuntime:
    package: runc-1.0.0-57.dev.git2abd837.el7.centos.x86_64
    path: /usr/bin/runc
    version: 'runc version spec: 1.0.0'
  SwapFree: 2009853952
  SwapTotal: 2147479552
  arch: amd64
  cpus: 4
  hostname: undercloud.localdomain
  kernel: 3.10.0-957.1.3.el7.x86_64
  os: linux
  rootless: false
  uptime: 28m 28.81s
insecure registries:
  registries:
  - 192.168.24.1:8787
  - 192.168.24.3:8787
registries:
  registries:
  - registry.centos.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  ConfigFile: /etc/containers/storage.conf
  ContainerStore:
    number: 90
  GraphDriverName: overlay
  GraphOptions: null
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
  ImageStore:
    number: 37
  RunRoot: /var/run/containers/storage

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

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 15, 2019
@EmilienM
Copy link
Contributor Author

We're not sure we have this issue all the times, we are still testing it. Just posted for the record for now.

@rhatdan
Copy link
Member

rhatdan commented Jan 15, 2019

@vrothberg Could you check this out.

@baude
Copy link
Member

baude commented Jan 15, 2019

@EmilienM any chance the image type (oci vs docker) could be a variable here?

@EmilienM
Copy link
Contributor Author

@baude same (docker) images as before.

@vrothberg
Copy link
Member

I can reproduce locally and will take a look

@vrothberg
Copy link
Member

Podman seems to not like {{if .Mode}}:{{.Mode}}{{end}}

@vrothberg
Copy link
Member

vrothberg commented Jan 15, 2019

The issue is that Podman doesn't fail with invalid keys as Docker does. The format mentioned in this issue doesn't seem to be correct, so nothing will be printed.

Docker will print errors such as Template parsing error: template: :1:20: executing "" at <.GraphDriver.Dta>: map has no entry for key "Dta".

There might be more issues and I will continue digging tomorrow.

@vrothberg vrothberg changed the title Backward incompability between docker & podman inspect podman inspect --format issues Jan 16, 2019
vrothberg added a commit to vrothberg/libpod that referenced this issue Jan 18, 2019
Return errors when executing the --format templates.  Otherwise,
Podman will just silently ignore them and not print any output
that could guide user into solving the issue.

Fixes: containers#2159
Signed-off-by: Valentin Rothberg <[email protected]>
@vrothberg
Copy link
Member

@EmilienM, #2181 should be a step in the right direction.

@vrothberg
Copy link
Member

Docker does not fail as it seems to have .Mode member in the .Mounts struct.

mheon pushed a commit to mheon/libpod that referenced this issue Feb 8, 2019
Return errors when executing the --format templates.  Otherwise,
Podman will just silently ignore them and not print any output
that could guide user into solving the issue.

Fixes: containers#2159
Signed-off-by: Valentin Rothberg <[email protected]>
@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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

5 participants