diff --git a/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml b/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml index 898651a..49de6da 100644 --- a/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml +++ b/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml @@ -138,10 +138,6 @@ spec: description: CtlplaneInterface - Interface on the provisioned nodes to use for ctlplane network type: string - ctlplaneNetmask: - description: 'CtlplaneNetmask - Netmask to use for ctlplane network - (TODO: acquire this is another manner?)' - type: string deploymentSSHSecret: description: DeploymentSSHSecret - Name of secret holding the cloud-admin ssh keys diff --git a/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml b/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml index 898651a..49de6da 100644 --- a/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml +++ b/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml @@ -138,10 +138,6 @@ spec: description: CtlplaneInterface - Interface on the provisioned nodes to use for ctlplane network type: string - ctlplaneNetmask: - description: 'CtlplaneNetmask - Netmask to use for ctlplane network - (TODO: acquire this is another manner?)' - type: string deploymentSSHSecret: description: DeploymentSSHSecret - Name of secret holding the cloud-admin ssh keys diff --git a/pkg/openstackbaremetalset/baremetalhost.go b/pkg/openstackbaremetalset/baremetalhost.go index 1d4077d..7e1b1e6 100644 --- a/pkg/openstackbaremetalset/baremetalhost.go +++ b/pkg/openstackbaremetalset/baremetalhost.go @@ -97,24 +97,9 @@ func BaremetalHostProvision( if networkDataSecret == nil { // Check IP version and set template variables accordingly - ipAddr, ipNet, err := net.ParseCIDR(ctlPlaneIP) + ipAddr, _, err := net.ParseCIDR(ctlPlaneIP) if err != nil { - // TODO: Remove this conversion once all usage sets ctlPlaneIP in CIDR format. - ipAddr = net.ParseIP(ctlPlaneIP) - if ipAddr == nil { - return err - } - - var ipPrefix int - if ipAddr.To4() != nil { - ipPrefix, _ = net.IPMask(net.ParseIP(instance.Spec.CtlplaneNetmask).To4()).Size() - } else { - ipPrefix, _ = net.IPMask(net.ParseIP(instance.Spec.CtlplaneNetmask).To16()).Size() - } - _, ipNet, err = net.ParseCIDR(fmt.Sprintf("%s/%d", ipAddr, ipPrefix)) - if err != nil { - return err - } + return err } CtlplaneIPVersion := "ipv6" @@ -127,7 +112,6 @@ func BaremetalHostProvision( templateParameters["CtlplaneIp"] = ipAddr templateParameters["CtlplaneInterface"] = instance.Spec.CtlplaneInterface templateParameters["CtlplaneGateway"] = instance.Spec.CtlplaneGateway - templateParameters["CtlplaneNetmask"] = net.IP(ipNet.Mask) if len(instance.Spec.BootstrapDNS) > 0 { templateParameters["CtlplaneDns"] = instance.Spec.BootstrapDNS } else { diff --git a/templates/openstackbaremetalset/cloudinit/networkdata b/templates/openstackbaremetalset/cloudinit/networkdata index 750381a..e097a6e 100644 --- a/templates/openstackbaremetalset/cloudinit/networkdata +++ b/templates/openstackbaremetalset/cloudinit/networkdata @@ -7,7 +7,6 @@ networks: id: {{ .CtlplaneInterface }} type: {{ .CtlplaneIpVersion }} ip_address: {{ .CtlplaneIp }} - netmask: "{{ .CtlplaneNetmask }}" {{- if (index . "CtlplaneGateway") }} routes: - network: {{ if eq .CtlplaneIpVersion "ipv6" }}"::"{{ else }}0.0.0.0{{ end }}