Skip to content

Commit

Permalink
SKS-1825: Support setting IPPools for network devices (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
haijianyang authored Dec 20, 2023
1 parent 5e75d87 commit bdebdaa
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions config/crd/bases/infrastructure.cluster.x-k8s.io_elfmachines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bdebdaa

Please sign in to comment.