@@ -34,10 +34,11 @@ func OpenStackMachine() OpenStackMachineBuilder {
34
34
// OpenStackMachineBuilder is used to build out an OpenStackMachine object.
35
35
type OpenStackMachineBuilder struct {
36
36
// ObjectMeta fields.
37
- annotations map [string ]string
38
- labels map [string ]string
39
- name string
40
- namespace string
37
+ annotations map [string ]string
38
+ labels map [string ]string
39
+ name string
40
+ namespace string
41
+ ownerReferences []metav1.OwnerReference
41
42
42
43
// Spec fields.
43
44
additionalBlockDevices []capov1.AdditionalBlockDevice
@@ -75,10 +76,11 @@ func (a OpenStackMachineBuilder) Build() *capov1.OpenStackMachine {
75
76
Kind : "OpenStackMachine" ,
76
77
},
77
78
ObjectMeta : metav1.ObjectMeta {
78
- Name : a .name ,
79
- Namespace : a .namespace ,
80
- Labels : a .labels ,
81
- Annotations : a .annotations ,
79
+ Name : a .name ,
80
+ Namespace : a .namespace ,
81
+ Labels : a .labels ,
82
+ Annotations : a .annotations ,
83
+ OwnerReferences : a .ownerReferences ,
82
84
},
83
85
Spec : capov1.OpenStackMachineSpec {
84
86
AdditionalBlockDevices : a .additionalBlockDevices ,
@@ -138,6 +140,12 @@ func (a OpenStackMachineBuilder) WithNamespace(namespace string) OpenStackMachin
138
140
return a
139
141
}
140
142
143
+ // WithOwnerReferences sets the OwnerReferences for the machine builder.
144
+ func (a OpenStackMachineBuilder ) WithOwnerReferences (ownerRefs []metav1.OwnerReference ) OpenStackMachineBuilder {
145
+ a .ownerReferences = ownerRefs
146
+ return a
147
+ }
148
+
141
149
// Spec fields.
142
150
143
151
// WithAdditionalBlockDevices sets the additionalBlockDevices for the OpenStackMachine builder.
0 commit comments