Browse code

api/t/container: drop NetworkSettingsBase

Except Bridge, all fields of NetworkSettingsBase were deprecated in
v1.44, and are actually never set at all.

The Bridge field was deprecated in v1.51 but it's only set when the
container is connected to the default bridge, and when the daemon is
started with the --bridge option set.

So, remove all those fields and do not backfill them for older API
versions.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>

Albin Kerouanton authored on 2025/09/10 23:33:31
Showing 3 changed files
... ...
@@ -1586,58 +1586,16 @@ definitions:
1586 1586
     description: "NetworkSettings exposes the network settings in the API"
1587 1587
     type: "object"
1588 1588
     properties:
1589
-      Bridge:
1590
-        description: |
1591
-          Name of the default bridge interface when dockerd's --bridge flag is set.
1592
-
1593
-          Deprecated: This field is only set when the daemon is started with the --bridge flag specified.
1594
-        type: "string"
1595
-        example: "docker0"
1596 1589
       SandboxID:
1597 1590
         description: SandboxID uniquely represents a container's network stack.
1598 1591
         type: "string"
1599 1592
         example: "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3"
1600
-      HairpinMode:
1601
-        description: |
1602
-          Indicates if hairpin NAT should be enabled on the virtual interface.
1603
-
1604
-          Deprecated: This field is never set and will be removed in a future release.
1605
-        type: "boolean"
1606
-        example: false
1607
-      LinkLocalIPv6Address:
1608
-        description: |
1609
-          IPv6 unicast address using the link-local prefix.
1610
-
1611
-          Deprecated: This field is never set and will be removed in a future release.
1612
-        type: "string"
1613
-        example: ""
1614
-      LinkLocalIPv6PrefixLen:
1615
-        description: |
1616
-          Prefix length of the IPv6 unicast address.
1617
-
1618
-          Deprecated: This field is never set and will be removed in a future release.
1619
-        type: "integer"
1620
-        example: ""
1621
-      Ports:
1622
-        $ref: "#/definitions/PortMap"
1623 1593
       SandboxKey:
1624 1594
         description: SandboxKey is the full path of the netns handle
1625 1595
         type: "string"
1626 1596
         example: "/var/run/docker/netns/8ab54b426c38"
1627
-
1628
-      SecondaryIPAddresses:
1629
-        description: "Deprecated: This field is never set and will be removed in a future release."
1630
-        type: "array"
1631
-        items:
1632
-          $ref: "#/definitions/Address"
1633
-        x-nullable: true
1634
-
1635
-      SecondaryIPv6Addresses:
1636
-        description: "Deprecated: This field is never set and will be removed in a future release."
1637
-        type: "array"
1638
-        items:
1639
-          $ref: "#/definitions/Address"
1640
-        x-nullable: true
1597
+      Ports:
1598
+        $ref: "#/definitions/PortMap"
1641 1599
       Networks:
1642 1600
         description: |
1643 1601
           Information about all networks that the container is connected to.
... ...
@@ -6,34 +6,10 @@ import (
6 6
 
7 7
 // NetworkSettings exposes the network settings in the api
8 8
 type NetworkSettings struct {
9
-	NetworkSettingsBase
10
-	Networks map[string]*network.EndpointSettings
11
-}
12
-
13
-// NetworkSettingsBase holds networking state for a container when inspecting it.
14
-//
15
-// Deprecated: Most fields in NetworkSettingsBase are deprecated. Fields which aren't deprecated will move to
16
-// NetworkSettings in v29.0, and this struct will be removed.
17
-type NetworkSettingsBase struct {
18
-	Bridge     string  // Deprecated: This field is only set when the daemon is started with the --bridge flag specified.
19 9
 	SandboxID  string  // SandboxID uniquely represents a container's network stack
20 10
 	SandboxKey string  // SandboxKey identifies the sandbox
21 11
 	Ports      PortMap // Ports is a collection of PortBinding indexed by Port
22
-
23
-	// HairpinMode specifies if hairpin NAT should be enabled on the virtual interface
24
-	//
25
-	// Deprecated: This field is never set and will be removed in a future release.
26
-	HairpinMode bool
27
-	// LinkLocalIPv6Address is an IPv6 unicast address using the link-local prefix
28
-	//
29
-	// Deprecated: This field is never set and will be removed in a future release.
30
-	LinkLocalIPv6Address string
31
-	// LinkLocalIPv6PrefixLen is the prefix length of an IPv6 unicast address
32
-	//
33
-	// Deprecated: This field is never set and will be removed in a future release.
34
-	LinkLocalIPv6PrefixLen int
35
-	SecondaryIPAddresses   []network.Address // Deprecated: This field is never set and will be removed in a future release.
36
-	SecondaryIPv6Addresses []network.Address // Deprecated: This field is never set and will be removed in a future release.
12
+	Networks   map[string]*network.EndpointSettings
37 13
 }
38 14
 
39 15
 // NetworkSettingsSummary provides a summary of container's networks
... ...
@@ -34,12 +34,6 @@ type CreateRequest struct {
34 34
 	CheckDuplicate *bool `json:",omitempty"`
35 35
 }
36 36
 
37
-// Address represents an IP address
38
-type Address struct {
39
-	Addr      string
40
-	PrefixLen int
41
-}
42
-
43 37
 // ServiceInfo represents service parameters with the list of service's tasks
44 38
 type ServiceInfo struct {
45 39
 	VIP          string