api/types: migrate more types to separate packages#48057
Merged
vvoland merged 9 commits intomoby:masterfrom Jul 2, 2024
Merged
api/types: migrate more types to separate packages#48057vvoland merged 9 commits intomoby:masterfrom
vvoland merged 9 commits intomoby:masterfrom
Conversation
thaJeztah
commented
Jun 25, 2024
d46c4f3 to
a4f4283
Compare
1 task
vvoland
approved these changes
Jul 2, 2024
|
|
||
| // DefaultNetworkSettings holds network information | ||
| // during the 2 release deprecation period. | ||
| // It will be removed in Docker 1.11. |
Contributor
There was a problem hiding this comment.
🙈
Should we remove that comment?
Member
Author
There was a problem hiding this comment.
LOL, I kept it as a reminding "why the h*ck didn't we still do that?". I know Albin was working on some of that, so I kept it for now.
Member
There was a problem hiding this comment.
Yeah, we need to discuss what we do with #45945. Ideally, we should not include this struct in newer API versions as it polutes the output of docker inspect.
api/types/container/container.go
Outdated
| // ContainerJSONBase contained all fields for API < 1.19, and InspectResponse | ||
| // held fields that were added in API 1.19 and up. Given that the minimum | ||
| // supported API version is now 1.24, we no longer use the separate type. | ||
| type Base struct { |
Contributor
There was a problem hiding this comment.
Nit: InspectBase would be slightly better IMO. Mainly because it's coupled with InspectResponse and we'd like to combine them anyway.
api/types/container/container.go
Outdated
| // for API version 1.18 and older. | ||
| // | ||
| // TODO(thaJeztah): combine Base and InspectResponse into a single struct. | ||
| // The split between Base (ContainerJSONBase) and InspecResponse (InspectResponse) |
Contributor
There was a problem hiding this comment.
Suggested change
| // The split between Base (ContainerJSONBase) and InspecResponse (InspectResponse) | |
| // The split between Base (ContainerJSONBase) and InspectResponse (InspectResponse) |
nit: typo
This moves the NetworkSettings, NetworkSettingsBase, DefaultNetworkSettings, and SummaryNetworkSettings types to the api/types/container package, and deprecates the old location. Signed-off-by: Sebastiaan van Stijn <[email protected]>
This moves the `Health` and `HealthcheckResult` types to the container package, as well as the related `NoHealthcheck`, `Starting`, `Healthy`, and `Unhealthy` consts. Signed-off-by: Sebastiaan van Stijn <[email protected]>
This moves the `MountPoint` type to the container package, and deprecates the old location. Signed-off-by: Sebastiaan van Stijn <[email protected]>
This moves the `Port` type to the container package, and deprecates the old location. Signed-off-by: Sebastiaan van Stijn <[email protected]>
The `GraphDriverData` type is shared between images and containers, and putting it in either package would result in a circular import, so adding a new package for this type. Signed-off-by: Sebastiaan van Stijn <[email protected]>
This moves the `ImageInspect` and `RootFS` types to the image package, and deprecates the old location. Signed-off-by: Sebastiaan van Stijn <[email protected]>
This moves the `ContainerState` type to the container package, renames it to `State`, and deprecates the old location. Signed-off-by: Sebastiaan van Stijn <[email protected]>
This moves the `Container` type to the containere package, rename it to `Summary`, and deprecates the old location. Signed-off-by: Sebastiaan van Stijn <[email protected]>
This moves the `ContainerJSONBase`, `ContainerJSON` and `ContainerNode` types to the api/types/container package and deprecates the old location. - `ContainerJSONBase` was renamed to `InspectBase` - `ContainerJSON` was rnamed to `InspectResponse` Signed-off-by: Sebastiaan van Stijn <[email protected]>
a4f4283 to
1abc8f6
Compare
krissetto
approved these changes
Jul 2, 2024
vvoland
approved these changes
Jul 2, 2024
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
api/types: move container-networksettings types to api/types/container
This moves the
NetworkSettings,NetworkSettingsBase,DefaultNetworkSettings,and
SummaryNetworkSettingstypes to the api/types/container package, anddeprecates the old location.
api/types: move container Health types to api/types/container
This moves the
HealthandHealthcheckResulttypes to the container package,as well as the related
NoHealthcheck,Starting,Healthy, andUnhealthyconsts.
api/types: move MountPoint to api/types/container
This moves the
MountPointtype to the container package, anddeprecates the old location.
api/types: move Port to api/types/container
This moves the
Porttype to the container package, anddeprecates the old location.
api/types: move GraphDriverData to api/types/storage
The
GraphDriverDatatype is shared between images and containers, andputting it in either package would result in a circular import, so adding
a new package for this type.
api/types: move ImageInspect and RootFS to api/types/image
This moves the
ImageInspectandRootFStypes to the image package,and deprecates the old location.
api/types: move ContainerState to api/types/image
This moves the
ContainerStatetype to the container package,renames it to
State, and deprecates the old location.api/types: move Container to api/types/container
This moves the
Containertype to the image package, rename it toSummary, and deprecates the old location.api/types: move container-inspect types to api/types/container
This moves the
ContainerJSONBase,ContainerJSONandContainerNodetypes to the api/types/container package and deprecates the old location.
ContainerJSONBasewas renamed toBaseContainerJSONwas rnamed toInspectResponse- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)