Skip to content

Commit

Permalink
deprecate NetworkConfig.ClusterNetworkCIDR
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobTanenbaum committed Jun 15, 2017
1 parent 7b572df commit 28e55c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 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 @@ -611,7 +611,7 @@ type UserAgentDenyRule struct {
// MasterNetworkConfig to be passed to the compiled in network plugin
type MasterNetworkConfig struct {
NetworkPluginName string
ClusterNetworkCIDR string
DeprecatedClusterNetworkCIDR string
ClusterNetworks []ClusterNetworkEntry
HostSubnetLength uint32
ServiceNetworkCIDR string
Expand Down
3 changes: 3 additions & 0 deletions pkg/cmd/server/api/v1/conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ 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}}
}
// Populate the new NetworkConfig.ServiceNetworkCIDR field from the KubernetesMasterConfig.ServicesSubnet field if needed
if len(obj.NetworkConfig.ServiceNetworkCIDR) == 0 {
if obj.KubernetesMasterConfig != nil && len(obj.KubernetesMasterConfig.ServicesSubnet) > 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 @@ -495,8 +495,8 @@ type RoutingConfig struct {
type MasterNetworkConfig struct {
// NetworkPluginName is the name of the network plugin to use
NetworkPluginName string `json:"networkPluginName"`
// ClusterNetworkCIDR is the CIDR string to specify the global overlay network's L3 space
ClusterNetworkCIDR string `json:"clusterNetworkCIDR"`
// Deprecated and maintained for backwards compatibility, use ClusterNetworks instead
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
Expand Down

0 comments on commit 28e55c5

Please sign in to comment.