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

feat: Update container inspect with size option #157

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

coderbirju
Copy link
Contributor

Issue #, if available:
Adds SizeRW and SizeRootFs options to inspect response

Inspect response without size option passed

{
  "Id": "842c7a142d2249f0c25e654a10e4fb10ac5ae2c7fa6cd6fa8d94dbc5fd44ac2c",
  "Created": "2025-02-10T19:43:07.960689829Z",
  "Path": "sleep",
  "Args": [],
  "State": { ...},
  "Image": "docker.io/library/ubuntu:latest",
  "ResolvConfPath": "/var/lib/nerdctl/1935db59/containers/finch/842c7a142d2249f0c25e654a10e4fb10ac5ae2c7fa6cd6fa8d94dbc5fd44ac2c/resolv.conf",
  "HostnamePath": "/var/lib/nerdctl/1935db59/containers/finch/842c7a142d2249f0c25e654a10e4fb10ac5ae2c7fa6cd6fa8d94dbc5fd44ac2c/hostname",
  "LogPath": "/var/lib/nerdctl/1935db59/containers/finch/842c7a142d2249f0c25e654a10e4fb10ac5ae2c7fa6cd6fa8d94dbc5fd44ac2c/842c7a142d2249f0c25e654a10e4fb10ac5ae2c7fa6cd6fa8d94dbc5fd44ac2c-json.log",
  "Name": "/my-test-container",
  "RestartCount": 0,
  "Driver": "overlayfs",
  "Platform": "linux",
  "AppArmorProfile": "",
   "Mounts": [...],
  "Config": {...}
  "NetworkSettings": null
}

Inspect response with size set (containers/<id>/json?size=1)

{
  "Id": "842c7a142d2249f0c25e654a10e4fb10ac5ae2c7fa6cd6fa8d94dbc5fd44ac2c",
  "Created": "2025-02-10T19:43:07.960689829Z",
  "Path": "sleep",
  "Args": [],
  "State": { ...},
  "Image": "docker.io/library/ubuntu:latest",
  "ResolvConfPath": "/var/lib/nerdctl/1935db59/containers/finch/842c7a142d2249f0c25e654a10e4fb10ac5ae2c7fa6cd6fa8d94dbc5fd44ac2c/resolv.conf",
  "HostnamePath": "/var/lib/nerdctl/1935db59/containers/finch/842c7a142d2249f0c25e654a10e4fb10ac5ae2c7fa6cd6fa8d94dbc5fd44ac2c/hostname",
  "LogPath": "/var/lib/nerdctl/1935db59/containers/finch/842c7a142d2249f0c25e654a10e4fb10ac5ae2c7fa6cd6fa8d94dbc5fd44ac2c/842c7a142d2249f0c25e654a10e4fb10ac5ae2c7fa6cd6fa8d94dbc5fd44ac2c-json.log",
  "Name": "/my-test-container",
  "RestartCount": 0,
  "Driver": "overlayfs",
  "Platform": "linux",
  "AppArmorProfile": "",
  "SizeRw": 4096,
  "SizeRootFs": 87609344,
  "Mounts": [...],
  "Config": {...}
  },
  "NetworkSettings": null
}

Description of changes:

Testing done:

  • I've reviewed the guidance in CONTRIBUTING.md

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@coderbirju coderbirju marked this pull request as ready for review February 10, 2025 19:49
Copy link
Contributor

@swagatbora90 swagatbora90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Signed-off-by: Arjun Raja Yogidas <[email protected]>
Signed-off-by: Arjun Raja Yogidas <[email protected]>
Signed-off-by: Arjun Raja Yogidas <[email protected]>
@coderbirju coderbirju force-pushed the update-container-inspect-new branch from a787d89 to 73cb155 Compare February 18, 2025 22:37
@swagatbora90 swagatbora90 merged commit b5df6ef into runfinch:main Feb 18, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants