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

Docker Compatibility API Timestamp Format #7860

Closed
hhergeth opened this issue Oct 1, 2020 · 3 comments
Closed

Docker Compatibility API Timestamp Format #7860

hhergeth opened this issue Oct 1, 2020 · 3 comments
Assignees
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. In Progress This issue is actively being worked by the assignee, please do not work on this at this time. 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

@hhergeth
Copy link

hhergeth commented Oct 1, 2020

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

/kind bug

Description

Docker compatibility endpoint /containers/id/json does not comply with the Docker API specification. The specs here show that the Created property is in ISO 8601 format. Podman on the other hand returns a string formatted differently (see below)

Line 318 in podman/pkg/api/handlers/compat/containers.go is the source of this behaviour:
Created: l.CreatedTime().String(),
This would have to be changed to something like:
Created: l.CreatedTime().Format(time.RFC3339),

Steps to reproduce the issue:

  1. Start the api as described: podman system service -t 5000 &

  2. Call the api endpoint: curl -s --unix-socket $XDG_RUNTIME_DIR/podman/podman.sock http://dummy/containers/id/json (format with jq for readability)

Describe the results you received:
A string formatted with Time.String() :
"Created": "2020-09-27 17:01:55.178157437 +0000 UTC",

Describe the results you expected:
A string in ISO-8601:
"Created": "2020-09-27T17:01:55.178157437",

Output of podman version:

Version:      2.1.1
API Version:  2.0.0
Go Version:   go1.15.2
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.16.1
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.20, commit: '
  cpus: 4
  distribution:
    distribution: ubuntu
    version: "19.10"
  eventLogger: journald
  hostname: <>
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.3.0-64-generic
  linkmode: dynamic
  memFree: 332857344
  memTotal: 16462323712
  ociRuntime:
    name: runc
    package: 'runc: /usr/sbin/runc'
    path: /usr/sbin/runc
    version: 'runc version spec: 1.0.1-dev'
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  rootless: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.1.4
      commit: unknown
      libslirp: 4.3.1-git
      SLIRP_CONFIG_VERSION_MAX: 3
  swapFree: 4162895872
  swapTotal: 8589930496
  uptime: 424h 54m 20.43s (Approximately 17.67 days)
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /home/<>/.config/containers/storage.conf
  containerStore:
    number: 68
    paused: 0
    running: 65
    stopped: 3
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: 'fuse-overlayfs: /usr/bin/fuse-overlayfs'
      Version: |-
        fusermount3 version: 3.4.1
        fuse-overlayfs: version 1.1.0
        FUSE library version 3.4.1
        using FUSE kernel interface version 7.27
  graphRoot: /home/<>/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 162
  runRoot: /run/user/1000/containers
  volumePath: /home/<>/.local/share/containers/storage/volumes
version:
  APIVersion: 2.0.0
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.15.2
  OsArch: linux/amd64
  Version: 2.1.1

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

podman/unknown,now 2.1.1~1 amd64 [installed]

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

Yes

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

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 1, 2020
@vrothberg
Copy link
Member

Thanks for opening the issue, @hhergeth!

@baude @jwhonce PTAL. I recall some timestamp issues but am not sure if this endpoint was affected.

@rhatdan
Copy link
Member

rhatdan commented Oct 1, 2020

Yes this endpoint should be fixed. The issues we had were with json output, that were difficult to fix.

@rhatdan rhatdan added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Oct 1, 2020
@3sky
Copy link

3sky commented Oct 7, 2020

/assign

@TomSweeneyRedHat TomSweeneyRedHat added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Oct 7, 2020
openshift-merge-robot added a commit that referenced this issue Oct 12, 2020
mheon pushed a commit to mheon/libpod that referenced this issue Oct 14, 2020
@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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. In Progress This issue is actively being worked by the assignee, please do not work on this at this time. 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

6 participants