Skip to content

Commit

Permalink
deprecate global HostSubnetLength
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobTanenbaum committed Jul 7, 2017
1 parent 30cfdbd commit 366baeb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/server/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ type MasterNetworkConfig struct {
NetworkPluginName string
DeprecatedClusterNetworkCIDR string
ClusterNetworks []ClusterNetworkEntry
HostSubnetLength uint32
DeprecatedHostSubnetLength uint32
ServiceNetworkCIDR string
// ExternalIPNetworkCIDRs controls what values are acceptable for the service external IP field. If empty, no externalIP
// may be set. It may contain a list of CIDRs which are checked for access. If a CIDR is prefixed with !, IPs in that
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/server/api/v1/conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error {
setDefault_ClientConnectionOverrides(obj.MasterClients.ExternalKubernetesClientConnectionOverrides)

if len(obj.NetworkConfig.ClusterNetworks) == 0 {
obj.NetworkConfig.ClusterNetworks = []ClusterNetworkEntry{{CIDR: obj.NetworkConfig.DeprecatedClusterNetworkCIDR}}
obj.NetworkConfig.ClusterNetworks = []ClusterNetworkEntry{{CIDR: obj.NetworkConfig.DeprecatedClusterNetworkCIDR, HostSubnetLength: obj.NetworkConfig.DeprecatedHostSubnetLength}}
}
// Populate the new NetworkConfig.ServiceNetworkCIDR field from the KubernetesMasterConfig.ServicesSubnet field if needed
if len(obj.NetworkConfig.ServiceNetworkCIDR) == 0 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/server/api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ type MasterNetworkConfig struct {
DeprecatedClusterNetworkCIDR string `json:"clusterNetworkCIDR,omitempty`
// ClusterNetworks is a list of cluster networks that defines the global overlay network's L3 space
ClusterNetworks []ClusterNetworkEntry `json:"clusterNetworks"`
// HostSubnetLength is the number of bits to allocate to each host's subnet e.g. 8 would mean a /24 network on the host
HostSubnetLength uint32 `json:"hostSubnetLength"`
// DeprecatedHostSubnetLength and maintined for backwards compatibility
DeprecatedHostSubnetLength uint32 `json:"hostSubnetLength, omitempty"`
// ServiceNetwork is the CIDR string to specify the service networks
ServiceNetworkCIDR string `json:"serviceNetworkCIDR"`
// ExternalIPNetworkCIDRs controls what values are acceptable for the service external IP field. If empty, no externalIP
Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/server/start/master_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ func (args MasterArgs) BuildSerializeableMasterConfig() (*configapi.MasterConfig
NetworkConfig: configapi.MasterNetworkConfig{
NetworkPluginName: args.NetworkArgs.NetworkPluginName,
ClusterNetworks: clusterNetworkConfig,
HostSubnetLength: args.NetworkArgs.HostSubnetLength,
ServiceNetworkCIDR: args.NetworkArgs.ServiceNetworkCIDR,
},

Expand Down
2 changes: 1 addition & 1 deletion pkg/sdn/plugin/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func StartMaster(networkConfig osconfigapi.MasterNetworkConfig, osClient *osclie

// Network: networkConfig.ClusterNetworkCIDR,
ClusterNetworks: clusterNetworkEntries,
HostSubnetLength: networkConfig.HostSubnetLength,
//HostSubnetLength: networkConfig.HostSubnetLength,
ServiceNetwork: networkConfig.ServiceNetworkCIDR,
PluginName: networkConfig.NetworkPluginName,
}
Expand Down

0 comments on commit 366baeb

Please sign in to comment.