Skip to content

Fix system df negative reclaimable size bug#25506

Merged
openshift-merge-bot[bot] merged 4 commits intocontainers:mainfrom
Luap99:disk-usage
Mar 17, 2025
Merged

Fix system df negative reclaimable size bug#25506
openshift-merge-bot[bot] merged 4 commits intocontainers:mainfrom
Luap99:disk-usage

Conversation

@Luap99
Copy link
Copy Markdown
Member

@Luap99 Luap99 commented Mar 7, 2025

Does this PR introduce a user-facing change?

Fixed a bug in podman system df where a negative size for RECLAIMABLE was shown.

@openshift-ci openshift-ci bot added release-note do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 7, 2025
@Luap99 Luap99 force-pushed the disk-usage branch 2 times, most recently from cb2969f to 897ad6a Compare March 11, 2025 19:16
@Luap99 Luap99 marked this pull request as ready for review March 11, 2025 19:19
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 11, 2025
Comment on lines +150 to +151
is "$output" ".*1[0-9].[0-9]\\+MB.*3.[0-9]\\+kB\\s\\+2.*" "Shared and Unique Size"
is "$output" ".*1[0-9].[0-9]\\+MB.*6.[0-9]\\+kB\\s\\+0.*" "Shared and Unique Size"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What do these two regexes check? Wouldn't it be better to use assert instead of is?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

assert or is should be the same here, because the test is using is overall I have opted to keep using is for consistency.

The sizes are non stable (metadat, different storage drivers, etc...) so I have opted to use a regex range that makes sense.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
is "$output" ".*1[0-9].[0-9]\\+MB.*3.[0-9]\\+kB\\s\\+2.*" "Shared and Unique Size"
is "$output" ".*1[0-9].[0-9]\\+MB.*6.[0-9]\\+kB\\s\\+0.*" "Shared and Unique Size"
# regex match: SHARED SIZE | UNIQUE SIZE | CONTAINERS
is "$output" ".*[1-9]\\d*\\.[0-9]\\+MB\\s\\+[1-9]\\d*\\.[0-9]\\+kB\\s\\+2.*" "Shared and Unique Size"
is "$output" ".*[1-9]\\d*\\.[0-9]\\+MB\\s\\+[1-9]\\d*\\.[0-9]\\+kB\\s\\+0.*" "Shared and Unique Size"

I would use this regex, which is preserved even when updating and resizing the image.

Maybe only one line could be checked. Because there is only a difference between the container numbers.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes that is an option if we want to allow all numbers, it certainly should make it more future proof on image changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that would be better.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok used assert and single quotes which hopefully should make the regex more readable, also I did not add 1-9 extra check as this seems like more complications that don't add any test value.

Copy link
Copy Markdown
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

LGTM
/approve

@TomSweeneyRedHat
Copy link
Copy Markdown
Member

LGTM

@TomSweeneyRedHat
Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 12, 2025
@giuseppe
Copy link
Copy Markdown
Member

@Luap99 could you please rebase this PR? I am curious to see if #25575 makes any difference

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 14, 2025
@Luap99
Copy link
Copy Markdown
Member Author

Luap99 commented Mar 14, 2025

Luap99 added 3 commits March 17, 2025 13:38
Includes my DiskUsage() changes.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Add a test for containers#24452

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Our calculation is just wrong and the way the entire API is designed it
cannot work. This is the same interface as docker is using and they have
the same bug there. So simply document this as known problem, in case
users complain we at least have something to point to.

An actual fix might be possible but not without reworking the full API
and because this is exposed in the docker compat and libpod REST API we
cannot really change it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Giuseppe is working on some proper fixes, for now in order to get this
moved along skip it so we can merge the disk usage fix.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@Luap99
Copy link
Copy Markdown
Member Author

Luap99 commented Mar 17, 2025

Ok I skipped the test on vfs for now unit we get the c/storage fix in. I like to get this merged and not wait for c/storage as there are more people with c/common changes and without this the tests will always fail for them.

Copy link
Copy Markdown
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, Honny1, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@baude
Copy link
Copy Markdown
Member

baude commented Mar 17, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 93675fd into containers:main Mar 17, 2025
88 checks passed
@Luap99 Luap99 deleted the disk-usage branch March 17, 2025 14:01
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jun 16, 2025
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Jun 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants