Skip to content

Commit af8a892

Browse files
authored
Merge pull request #490 from kyounghunJang/Add-DefaultNetwork
Add a DefaultNetwork field to NetworkInfo
2 parents 9c73904 + 905f456 commit af8a892

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

common/libnetwork/cni/network.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,10 @@ func (n *cniNetwork) NetworkInfo() types.NetworkInfo {
327327
}
328328

329329
info := types.NetworkInfo{
330-
Backend: types.CNI,
331-
Package: packageVersion,
332-
Path: path,
330+
Backend: types.CNI,
331+
Package: packageVersion,
332+
Path: path,
333+
DefaultNetwork: n.defaultNetwork,
333334
}
334335

335336
dnsPath := filepath.Join(path, "dnsname")

common/libnetwork/netavark/network.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,11 @@ func (n *netavarkNetwork) NetworkInfo() types.NetworkInfo {
369369
logrus.Infof("Failed to get the netavark version: %v", err)
370370
}
371371
info := types.NetworkInfo{
372-
Backend: types.Netavark,
373-
Version: programVersion,
374-
Package: packageVersion,
375-
Path: path,
372+
Backend: types.Netavark,
373+
Version: programVersion,
374+
Package: packageVersion,
375+
Path: path,
376+
DefaultNetwork: n.defaultNetwork,
376377
}
377378

378379
dnsPath := n.aardvarkBinary

common/libnetwork/types/network.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,12 @@ type NetworkUpdateOptions struct {
9797

9898
// NetworkInfo contains the network information.
9999
type NetworkInfo struct {
100-
Backend NetworkBackend `json:"backend"`
101-
Version string `json:"version,omitempty"`
102-
Package string `json:"package,omitempty"`
103-
Path string `json:"path,omitempty"`
104-
DNS DNSNetworkInfo `json:"dns,omitempty"`
100+
Backend NetworkBackend `json:"backend"`
101+
Version string `json:"version,omitempty"`
102+
Package string `json:"package,omitempty"`
103+
Path string `json:"path,omitempty"`
104+
DNS DNSNetworkInfo `json:"dns,omitempty"`
105+
DefaultNetwork string `json:"default_network,omitempty"`
105106
}
106107

107108
// DNSNetworkInfo contains the DNS information.

0 commit comments

Comments
 (0)