11package installconfig
22
33import (
4- "net"
54 "os"
65
76 "github.com/ghodss/yaml"
@@ -11,6 +10,7 @@ import (
1110
1211 netopv1 "github.com/openshift/cluster-network-operator/pkg/apis/networkoperator/v1"
1312 "github.com/openshift/installer/pkg/asset"
13+ "github.com/openshift/installer/pkg/asset/installconfig/libvirt"
1414 "github.com/openshift/installer/pkg/ipnet"
1515 "github.com/openshift/installer/pkg/types"
1616 openstackvalidation "github.com/openshift/installer/pkg/types/openstack/validation"
@@ -23,7 +23,8 @@ const (
2323)
2424
2525var (
26- defaultServiceCIDR = parseCIDR ("172.30.0.0/16" )
26+ defaultMachineCIDR = ipnet .MustParseCIDR ("10.0.0.0/16" )
27+ defaultServiceCIDR = ipnet .MustParseCIDR ("172.30.0.0/16" )
2728 defaultClusterCIDR = "10.128.0.0/14"
2829 defaultHostSubnetLength = 9 // equivalent to a /23 per node
2930)
@@ -74,11 +75,9 @@ func (a *InstallConfig) Generate(parents asset.Parents) error {
7475 SSHKey : sshPublicKey .Key ,
7576 BaseDomain : baseDomain .BaseDomain ,
7677 Networking : types.Networking {
77- Type : "OpenshiftSDN" ,
78-
79- ServiceCIDR : ipnet.IPNet {
80- IPNet : defaultServiceCIDR ,
81- },
78+ Type : "OpenshiftSDN" ,
79+ MachineCIDR : * defaultMachineCIDR ,
80+ ServiceCIDR : * defaultServiceCIDR ,
8281 ClusterNetworks : []netopv1.ClusterNetwork {
8382 {
8483 CIDR : defaultClusterCIDR ,
@@ -96,6 +95,7 @@ func (a *InstallConfig) Generate(parents asset.Parents) error {
9695 a .Config .AWS = platform .AWS
9796 case platform .Libvirt != nil :
9897 a .Config .Libvirt = platform .Libvirt
98+ a .Config .Networking .MachineCIDR = * libvirt .DefaultMachineCIDR
9999 numberOfMasters = 1
100100 numberOfWorkers = 1
101101 case platform .None != nil :
@@ -142,11 +142,6 @@ func (a *InstallConfig) Files() []*asset.File {
142142 return []* asset.File {}
143143}
144144
145- func parseCIDR (s string ) net.IPNet {
146- _ , cidr , _ := net .ParseCIDR (s )
147- return * cidr
148- }
149-
150145// Load returns the installconfig from disk.
151146func (a * InstallConfig ) Load (f asset.FileFetcher ) (found bool , err error ) {
152147 file , err := fetchInstallConfigFile (f )
0 commit comments