Skip to content

Commit b66aeb6

Browse files
Merge pull request #293 from hjensas/ctlplane_interface_node_override
Allow override CtlplaneInterface in InstanceSpec
2 parents f00958d + fa8ff7a commit b66aeb6

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ spec:
8787
description: 'CtlplaneGateway - IP of gateway for ctrlplane
8888
network (TODO: acquire this is another manner?)'
8989
type: string
90+
ctlplaneInterface:
91+
description: CtlplaneInterface - Interface on the provisioned
92+
nodes to use for ctlplane network
93+
type: string
9094
ctlplaneVlan:
9195
description: CtlplaneVlan - Vlan for ctlplane network
9296
type: integer

api/v1beta1/openstackbaremetalset_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ type InstanceSpec struct {
3737
// CtlplaneGateway - IP of gateway for ctrlplane network (TODO: acquire this is another manner?)
3838
// +kubebuilder:validation:Optional
3939
CtlplaneGateway string `json:"ctlplaneGateway,omitempty"`
40+
// CtlplaneInterface - Interface on the provisioned nodes to use for ctlplane network
41+
// +kubebuilder:validation:Optional
42+
CtlplaneInterface string `json:"ctlplaneInterface,omitempty"`
4043
// +kubebuilder:validation:Optional
4144
// CtlplaneVlan - Vlan for ctlplane network
4245
CtlplaneVlan *int `json:"ctlplaneVlan,omitempty"`

config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ spec:
8787
description: 'CtlplaneGateway - IP of gateway for ctrlplane
8888
network (TODO: acquire this is another manner?)'
8989
type: string
90+
ctlplaneInterface:
91+
description: CtlplaneInterface - Interface on the provisioned
92+
nodes to use for ctlplane network
93+
type: string
9094
ctlplaneVlan:
9195
description: CtlplaneVlan - Vlan for ctlplane network
9296
type: integer

pkg/openstackbaremetalset/baremetalhost.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ func BaremetalHostProvision(
115115
} else if instance.Spec.CtlplaneVlan != nil {
116116
templateParameters["CtlplaneVlan"] = *instance.Spec.CtlplaneVlan
117117
}
118-
templateParameters["CtlplaneInterface"] = instance.Spec.CtlplaneInterface
118+
if instance.Spec.BaremetalHosts[hostName].CtlplaneInterface != "" {
119+
templateParameters["CtlplaneInterface"] = instance.Spec.BaremetalHosts[hostName].CtlplaneInterface
120+
} else {
121+
templateParameters["CtlplaneInterface"] = instance.Spec.CtlplaneInterface
122+
}
119123
if instance.Spec.BaremetalHosts[hostName].CtlplaneGateway != "" {
120124
templateParameters["CtlplaneGateway"] = instance.Spec.BaremetalHosts[hostName].CtlplaneGateway
121125
} else {

0 commit comments

Comments
 (0)