diff --git a/api/v1beta1/types.go b/api/v1beta1/types.go index 8f98f83f..e18cf5ab 100644 --- a/api/v1beta1/types.go +++ b/api/v1beta1/types.go @@ -16,6 +16,10 @@ limitations under the License. package v1beta1 +import ( + corev1 "k8s.io/api/core/v1" +) + // CloneMode is the type of clone operation used to clone a VM from a template. type CloneMode string @@ -137,6 +141,11 @@ type NetworkDeviceSpec struct { // Required when DHCP4 is false. // +optional Routes []NetworkDeviceRouteSpec `json:"routes,omitempty"` + + // AddressesFromPools is a list of IPAddressPools that should be assigned + // to IPAddressClaims. + // +optional + AddressesFromPools []corev1.TypedLocalObjectReference `json:"addressesFromPools,omitempty"` } func (d *NetworkDeviceSpec) HasNetworkType() bool { diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index d1f535c0..d741329a 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -22,6 +22,7 @@ limitations under the License. package v1beta1 import ( + "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/errors" @@ -417,6 +418,13 @@ func (in *NetworkDeviceSpec) DeepCopyInto(out *NetworkDeviceSpec) { *out = make([]NetworkDeviceRouteSpec, len(*in)) copy(*out, *in) } + if in.AddressesFromPools != nil { + in, out := &in.AddressesFromPools, &out.AddressesFromPools + *out = make([]v1.TypedLocalObjectReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDeviceSpec. diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_elfmachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_elfmachines.yaml index 007b3c3d..e00060db 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_elfmachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_elfmachines.yaml @@ -115,6 +115,32 @@ spec: description: NetworkDeviceSpec defines the network configuration for a virtual machine's network device. properties: + addressesFromPools: + description: AddressesFromPools is a list of IPAddressPools + that should be assigned to IPAddressClaims. + items: + description: TypedLocalObjectReference contains enough + information to let you locate the typed referenced object + inside the same namespace. + properties: + apiGroup: + description: APIGroup is the group for the resource + being referenced. If APIGroup is not specified, + the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + type: array ipAddrs: description: IPAddrs is a list of one or more IPv4 and/or IPv6 addresses to assign to this device. Required when diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_elfmachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_elfmachinetemplates.yaml index 4be744ae..2c4072be 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_elfmachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_elfmachinetemplates.yaml @@ -96,6 +96,35 @@ spec: description: NetworkDeviceSpec defines the network configuration for a virtual machine's network device. properties: + addressesFromPools: + description: AddressesFromPools is a list of IPAddressPools + that should be assigned to IPAddressClaims. + items: + description: TypedLocalObjectReference contains + enough information to let you locate the typed + referenced object inside the same namespace. + properties: + apiGroup: + description: APIGroup is the group for the + resource being referenced. If APIGroup is + not specified, the specified Kind must be + in the core API group. For any other third-party + types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource + being referenced + type: string + name: + description: Name is the name of resource + being referenced + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + type: array ipAddrs: description: IPAddrs is a list of one or more IPv4 and/or IPv6 addresses to assign to this device.