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

Comments

Projects
None yet
5 participants
@EmilienM
Copy link
Contributor

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

@EmilienM

This comment has been minimized.

Copy link
Contributor Author

commented Jan 15, 2019

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

@rhatdan

This comment has been minimized.

Copy link
Member

commented Jan 15, 2019

@vrothberg Could you check this out.

@baude

This comment has been minimized.

Copy link
Collaborator

commented Jan 15, 2019

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

@EmilienM

This comment has been minimized.

Copy link
Contributor Author

commented Jan 15, 2019

@baude same (docker) images as before.

@vrothberg

This comment has been minimized.

Copy link
Member

commented Jan 15, 2019

I can reproduce locally and will take a look

@vrothberg

This comment has been minimized.

Copy link
Member

commented Jan 15, 2019

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

@vrothberg

This comment has been minimized.

Copy link
Member

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

podman-inspect: don't ignore errors
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 <rothberg@redhat.com>
@vrothberg

This comment has been minimized.

Copy link
Member

commented Jan 18, 2019

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

@vrothberg

This comment has been minimized.

Copy link
Member

commented Jan 18, 2019

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

mheon added a commit to mheon/libpod that referenced this issue Feb 8, 2019

podman-inspect: don't ignore errors
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 <rothberg@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.