dotnet / dotnet/Docker.DotNet

`ContainerInspectParameters.IncludeSize` is defined but never used

Open
#694 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
2.4k
Forks
416
PR merge metrics
No merged PRs in 30d

Description

# Problem
I am trying to get the disk usage size of a container using `docker inspect`. [`InspectContainerAsync`](https://github.com/dotnet/Docker.DotNet/blob/c0f44a7000221a7bc1ced1154939e19caeea067a/src/Docker.DotNet/Endpoints/ContainerOperations.cs#L66) call returns a [`ContainerInspectResponse`](https://github.com/dotnet/Docker.DotNet/blob/c0f44a7000221a7bc1ced1154939e19caeea067a/src/Docker.DotNet/Models/ContainerInspectResponse.Generated.cs#L107) object that contains `SizeRw` and `SizeRootFs` fields. However, these always return null.

This should have a simple solution where we pass a [`ContainerInspectParameters`](https://github.com/dotnet/Docker.DotNet/blob/c0f44a7000221a7bc1ced1154939e19caeea067a/src/Docker.DotNet/Models/ContainerInspectParameters.Generated.cs#L4) with `IncludeSize` property to `InspectContainerAsync` to tell the SDK to populate those values. However, inspect operations do not accept any parameters object. This results in an inability to specify the `IncludeSize` flag while inspecting containers. `ContainerInspectParameters` very much feels like it is designed for this purpose, but it is never used. More interestingly, in the [`ContainerOperations`](https://github.com/dotnet/Docker.DotNet/blob/c0f44a7000221a7bc1ced1154939e19caeea067a/src/Docker.DotNet/Endpoints/ContainerOperations.cs#L66), almost all operations take a parameters object, except the inspect operations.

# Oversight
I believe there is an oversight in the implementation of this SDK in this regard. Could you please look at this?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.