Skip to content

Conversation

@akerouanton
Copy link
Member

@akerouanton akerouanton commented Aug 28, 2025

- 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

- Go-SDK: Deprecate field `NetworkSettingsBase.Bridge`, struct `NetworkSettingsBase`, all the fields of `DefaultNetworkSettings`, and struct `DefaultNetworkSettings`.

@akerouanton akerouanton added this to the 28.4.0 milestone Aug 28, 2025
@akerouanton akerouanton self-assigned this Aug 28, 2025
@akerouanton akerouanton force-pushed the 28.x-deprecate-NetworkSettingsBase branch from 81753cc to 79f906f Compare August 28, 2025 16:33
//
// Deprecated: use [container.NetworkSettingsBase].
type NetworkSettingsBase = container.NetworkSettingsBase
// Deprecated: use [container.NetworkSettings].
Copy link
Member

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")?

Copy link
Member Author

@akerouanton akerouanton Aug 29, 2025

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.

Copy link
Member Author

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.

@akerouanton akerouanton added the impact/go-sdk Noteworthy (compatibility changes) in the Go SDK label Aug 29, 2025
@akerouanton akerouanton marked this pull request as draft August 29, 2025 13:42
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]>
@akerouanton akerouanton force-pushed the 28.x-deprecate-NetworkSettingsBase branch 2 times, most recently from ddebb28 to e49d304 Compare August 29, 2025 15:31
@akerouanton akerouanton marked this pull request as ready for review August 29, 2025 15:31
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]>
@akerouanton akerouanton force-pushed the 28.x-deprecate-NetworkSettingsBase branch from e49d304 to 660b67b Compare August 29, 2025 16:31
@vvoland vvoland merged commit ee15931 into moby:28.x Aug 29, 2025
239 of 241 checks passed
@akerouanton akerouanton deleted the 28.x-deprecate-NetworkSettingsBase branch August 29, 2025 17:57
@thompson-shaun thompson-shaun moved this from New to Complete in 🔦 Maintainer spotlight Sep 4, 2025
@thompson-shaun thompson-shaun moved this from Complete to New in 🔦 Maintainer spotlight Sep 4, 2025
@thompson-shaun thompson-shaun moved this from New to Complete in 🔦 Maintainer spotlight Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API area/networking Networking impact/deprecation impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code status/4-merge

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants