Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions pkg/network/master/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,22 @@ func Start(networkConfig osconfigapi.MasterNetworkConfig, networkClient networkc
panic("No ClusterNetworks set in networkConfig; should have been defaulted in if not configured")
}

var parsedClusterNetworkEntries []networkapi.ClusterNetworkEntry
for _, entry := range master.networkInfo.ClusterNetworks {
parsedClusterNetworkEntries = append(parsedClusterNetworkEntries, networkapi.ClusterNetworkEntry{CIDR: entry.ClusterCIDR.String(), HostSubnetLength: entry.HostSubnetLength})
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another reason for converting master.networkInfo.ClusterNetworks to []networkapi.ClusterNetworkEntry


configCN := &networkapi.ClusterNetwork{
TypeMeta: metav1.TypeMeta{Kind: "ClusterNetwork"},
ObjectMeta: metav1.ObjectMeta{Name: networkapi.ClusterNetworkDefault},

ClusterNetworks: clusterNetworkEntries,
ServiceNetwork: networkConfig.ServiceNetworkCIDR,
ClusterNetworks: parsedClusterNetworkEntries,
ServiceNetwork: master.networkInfo.ServiceNetwork.String(),
PluginName: networkConfig.NetworkPluginName,

// Need to set these for backward compat
Network: clusterNetworkEntries[0].CIDR,
HostSubnetLength: clusterNetworkEntries[0].HostSubnetLength,
Network: parsedClusterNetworkEntries[0].CIDR,
HostSubnetLength: parsedClusterNetworkEntries[0].HostSubnetLength,
}
osapivalidation.SetDefaultClusterNetwork(*configCN)

Expand Down