Skip to content

[28.x] api/types: deprecate disk usage types for build cache, container, ima…#50768

Merged
austinvazquez merged 2 commits intomoby:28.xfrom
austinvazquez:deprecate-disk-usage-structs-in-api
Aug 19, 2025
Merged

[28.x] api/types: deprecate disk usage types for build cache, container, ima…#50768
austinvazquez merged 2 commits intomoby:28.xfrom
austinvazquez:deprecate-disk-usage-structs-in-api

Conversation

@austinvazquez
Copy link
Contributor

@austinvazquez austinvazquez commented Aug 19, 2025

…ges, and volumes

- What I did

This change marks the disk usage structs in api/types/build, api/types/container, api/types/images, and api/types/volumes as deprecated.

- How I did it

- How to verify it

- Human readable description for the release notes

Go SDK: api/types: `build.CacheDiskUsage`,  `container.DiskUsage`, `images.DiskUsage` and `volumes.DiskUsage` are now deprecated and will be removed in the next major release.

- A picture of a cute animal (not mandatory but encouraged)

…ges, and volumes

These types are only used internal to the daemon and will be removed from the api in the next release.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Member

Ah derp; we probably need some exclusion in the golangci-lint settings;

api/server/router/system/system_routes.go:244:20: SA1019: buildtypes.CacheDiskUsage is deprecated: this type is no longer used and will be removed in the next release. (staticcheck)
		du.BuildCache = &buildtypes.CacheDiskUsage{
		                 ^
api/types/backend/disk_usage.go:25:14: SA1019: image.DiskUsage is deprecated: this type is no longer used and will be removed in the next release. (staticcheck)
	Images     *image.DiskUsage
	            ^

Or maybe do the copying after all in this branch

@austinvazquez
Copy link
Contributor Author

austinvazquez commented Aug 19, 2025

Oh, that's funny one of the few times I didn't run validate locally when creating the PR.

…ge in daemon

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
@austinvazquez
Copy link
Contributor Author

@thaJeztah , I pushed a commit to silence the linters regarding deprecated type usage in the daemon if you can take another look.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

works for me if the linter is happy

LGTM

@thaJeztah
Copy link
Member

Oh, that's funny one of the few times I didn't run validate locally when creating the PR.

It's also not always consistent; I've had cases where I added a //nolint flag because I deprecated something and then it complained "redundant //nolint" 🤷‍♂️)

@austinvazquez austinvazquez merged commit 436c33f into moby:28.x Aug 19, 2025
226 of 227 checks passed
@austinvazquez austinvazquez deleted the deprecate-disk-usage-structs-in-api branch August 19, 2025 16:43
@thaJeztah thaJeztah added this to the 28.4.0 milestone Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants