-
Notifications
You must be signed in to change notification settings - Fork 18.9k
[28.x] deprecate NetworkSettingsBase, DefaultNetworkSettings #50839
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
[28.x] deprecate NetworkSettingsBase, DefaultNetworkSettings #50839
Conversation
81753cc to
79f906f
Compare
api/types/types_deprecated.go
Outdated
| // | ||
| // Deprecated: use [container.NetworkSettingsBase]. | ||
| type NetworkSettingsBase = container.NetworkSettingsBase | ||
| // Deprecated: use [container.NetworkSettings]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this intentionally pointing to the other type? (not "base")?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NetworkSettingsBase is deprecated but it contains three fields that aren't — namely SandboxID, SandboxKey and Ports. These will be moved to NetworkSettings in v29.
This type is embedded in NetworkSettings, so aliasing NetworkSettingsBase to container.NetworkSettings would provide seamless migration to api v2.
But I'm not sure whether this is the right approach. Let me know what you think about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably a bad idea though. So, I decided to not touch the alias itself but to only update the deprecation warning.
container.NetworkSettingsBase is deprecated in v28.4, and scheduled for
removal in v29. However, it contains three fields that aren't deprecated
and that will be moved to NetworkSettings.
Update the deprecation notice on NetworkSettingsBase to advise users
to access NetworkSettingsBase's fields through NetworkSettings.
This field provides little value as it's only set when the daemon is started with --bridge flag specified, and the inspected container is connected to the default bridge network. Unfortunately, there's no equivalent field in NetworkSettings.Networks. Signed-off-by: Albin Kerouanton <[email protected]> (cherry picked from commit 16dc391) Signed-off-by: Albin Kerouanton <[email protected]>
ddebb28 to
e49d304
Compare
Most fields in NetworkSettingsBase are deprecated, so deprecate the whole struct. The few fields which aren't deprecated will move to the NetworkSettings struct in v29. Signed-off-by: Albin Kerouanton <[email protected]> (cherry picked from commit 80bb864) Signed-off-by: Albin Kerouanton <[email protected]>
Signed-off-by: Albin Kerouanton <[email protected]> (cherry picked from commit d0de293) Signed-off-by: Albin Kerouanton <[email protected]>
This struct is only used to report the networking state for the default bridge network when the container is connected to it. It was deprecated in v1.09 (API v1.21), and scheduled for removal in v1.11. Unfortunately, the deprecation warning was wrongly formatted in the Go code. However, deprecation warnings are already present in swagger.yaml, so don't touch it. Signed-off-by: Albin Kerouanton <[email protected]> (cherry picked from commit b7c597e) Signed-off-by: Albin Kerouanton <[email protected]>
container.NetworkSettingsBase is deprecated in v28.4, and scheduled for removal in v29. However, it contains three fields that aren't deprecated and that will be moved to NetworkSettings. Update the deprecation notice on NetworkSettingsBase to advise users to access NetworkSettingsBase's fields through NetworkSettings. Signed-off-by: Albin Kerouanton <[email protected]>
e49d304 to
660b67b
Compare
- What I did
api/t/ctr: deprecate NetworkSettingsBase.Bridge
This field provides little value as it's only set when the daemon is started with --bridge flag specified. There's no equivalent field in NetworkSettings. Deprecate it.
api/t/ctr: deprecate NetworkSettingsBase
Most fields in NetworkSettingsBase are deprecated, so deprecate the whole struct. The few fields which aren't deprecated will move to the NetworkSettings struct in v29.
Mark all deprecated fields as
omitempty.api/t/ctr: deprecate DefaultNetworkSettings
This struct is only used to report the networking state for the default bridge network when the container is connected to it.
It was deprecated in v1.09 (API v1.21) but has never been removed since then. Unfortunately, the deprecation warning was wrongly formatted.
Fix the deprecation warning.
- Human readable description for the release notes