Skip to content

Commit cc562dc

Browse files
committed
more tests, new network interface support on LinodeMachines
1 parent 770f9c2 commit cc562dc

File tree

7 files changed

+964
-30
lines changed

7 files changed

+964
-30
lines changed

api/v1alpha2/linodemachine_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ type LinodeMachineSpec struct {
6262
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
6363
Interfaces []InstanceConfigInterfaceCreateOptions `json:"interfaces,omitempty"`
6464
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
65+
LinodeInterfaces []linodego.LinodeInterfaceCreateOptions `json:"linodeInterfaces,omitempty"`
66+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
6567
BackupsEnabled bool `json:"backupsEnabled,omitempty"`
6668
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
6769
PrivateIP *bool `json:"privateIP,omitempty"`

api/v1alpha2/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/infrastructure.cluster.x-k8s.io_linodemachines.yaml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,118 @@ spec:
301301
x-kubernetes-validations:
302302
- message: Value is immutable
303303
rule: self == oldSelf
304+
linodeInterfaces:
305+
items:
306+
properties:
307+
default_route:
308+
properties:
309+
ipv4:
310+
type: boolean
311+
ipv6:
312+
type: boolean
313+
type: object
314+
firewall_id:
315+
type: integer
316+
public:
317+
properties:
318+
ipv4:
319+
properties:
320+
addresses:
321+
items:
322+
properties:
323+
address:
324+
type: string
325+
primary:
326+
type: boolean
327+
required:
328+
- address
329+
type: object
330+
type: array
331+
type: object
332+
ipv6:
333+
properties:
334+
ranges:
335+
items:
336+
properties:
337+
range:
338+
type: string
339+
required:
340+
- range
341+
type: object
342+
type: array
343+
type: object
344+
type: object
345+
vlan:
346+
properties:
347+
ipam_address:
348+
type: string
349+
vlan_label:
350+
type: string
351+
required:
352+
- vlan_label
353+
type: object
354+
vpc:
355+
properties:
356+
ipv4:
357+
properties:
358+
addresses:
359+
items:
360+
properties:
361+
address:
362+
type: string
363+
nat_1_1_address:
364+
type: string
365+
primary:
366+
type: boolean
367+
required:
368+
- address
369+
type: object
370+
type: array
371+
ranges:
372+
items:
373+
properties:
374+
range:
375+
type: string
376+
required:
377+
- range
378+
type: object
379+
type: array
380+
type: object
381+
ipv6:
382+
properties:
383+
is_public:
384+
type: boolean
385+
ranges:
386+
items:
387+
properties:
388+
range:
389+
type: string
390+
required:
391+
- range
392+
type: object
393+
type: array
394+
slaac:
395+
items:
396+
properties:
397+
range:
398+
type: string
399+
required:
400+
- range
401+
type: object
402+
type: array
403+
required:
404+
- is_public
405+
type: object
406+
subnet_id:
407+
type: integer
408+
required:
409+
- subnet_id
410+
type: object
411+
type: object
412+
type: array
413+
x-kubernetes-validations:
414+
- message: Value is immutable
415+
rule: self == oldSelf
304416
networkHelper:
305417
description: |-
306418
NetworkHelper is an option usually enabled on account level. It helps configure networking automatically for instances.

config/crd/bases/infrastructure.cluster.x-k8s.io_linodemachinetemplates.yaml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,118 @@ spec:
293293
x-kubernetes-validations:
294294
- message: Value is immutable
295295
rule: self == oldSelf
296+
linodeInterfaces:
297+
items:
298+
properties:
299+
default_route:
300+
properties:
301+
ipv4:
302+
type: boolean
303+
ipv6:
304+
type: boolean
305+
type: object
306+
firewall_id:
307+
type: integer
308+
public:
309+
properties:
310+
ipv4:
311+
properties:
312+
addresses:
313+
items:
314+
properties:
315+
address:
316+
type: string
317+
primary:
318+
type: boolean
319+
required:
320+
- address
321+
type: object
322+
type: array
323+
type: object
324+
ipv6:
325+
properties:
326+
ranges:
327+
items:
328+
properties:
329+
range:
330+
type: string
331+
required:
332+
- range
333+
type: object
334+
type: array
335+
type: object
336+
type: object
337+
vlan:
338+
properties:
339+
ipam_address:
340+
type: string
341+
vlan_label:
342+
type: string
343+
required:
344+
- vlan_label
345+
type: object
346+
vpc:
347+
properties:
348+
ipv4:
349+
properties:
350+
addresses:
351+
items:
352+
properties:
353+
address:
354+
type: string
355+
nat_1_1_address:
356+
type: string
357+
primary:
358+
type: boolean
359+
required:
360+
- address
361+
type: object
362+
type: array
363+
ranges:
364+
items:
365+
properties:
366+
range:
367+
type: string
368+
required:
369+
- range
370+
type: object
371+
type: array
372+
type: object
373+
ipv6:
374+
properties:
375+
is_public:
376+
type: boolean
377+
ranges:
378+
items:
379+
properties:
380+
range:
381+
type: string
382+
required:
383+
- range
384+
type: object
385+
type: array
386+
slaac:
387+
items:
388+
properties:
389+
range:
390+
type: string
391+
required:
392+
- range
393+
type: object
394+
type: array
395+
required:
396+
- is_public
397+
type: object
398+
subnet_id:
399+
type: integer
400+
required:
401+
- subnet_id
402+
type: object
403+
type: object
404+
type: array
405+
x-kubernetes-validations:
406+
- message: Value is immutable
407+
rule: self == oldSelf
296408
networkHelper:
297409
description: |-
298410
NetworkHelper is an option usually enabled on account level. It helps configure networking automatically for instances.

docs/src/reference/out.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ _Appears in:_
626626
| `backupID` _integer_ | | | |
627627
| `image` _string_ | | | |
628628
| `interfaces` _[InstanceConfigInterfaceCreateOptions](#instanceconfiginterfacecreateoptions) array_ | | | |
629+
| `linodeInterfaces` _LinodeInterfaceCreateOptions array_ | | | |
629630
| `backupsEnabled` _boolean_ | | | |
630631
| `privateIP` _boolean_ | | | |
631632
| `tags` _string array_ | Tags is a list of tags to apply to the Linode instance. | | |

internal/controller/linodemachine_controller_helpers.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -920,17 +920,18 @@ func linodeMachineSpecToInstanceCreateConfig(machineSpec infrav1alpha2.LinodeMac
920920
privateIP = *machineSpec.PrivateIP
921921
}
922922
return &linodego.InstanceCreateOptions{
923-
Region: machineSpec.Region,
924-
Type: machineSpec.Type,
925-
AuthorizedKeys: machineSpec.AuthorizedKeys,
926-
AuthorizedUsers: machineSpec.AuthorizedUsers,
927-
RootPass: machineSpec.RootPass,
928-
Image: machineSpec.Image,
929-
Interfaces: interfaces,
930-
PrivateIP: privateIP,
931-
Tags: machineTags,
932-
FirewallID: machineSpec.FirewallID,
933-
DiskEncryption: linodego.InstanceDiskEncryption(machineSpec.DiskEncryption),
923+
Region: machineSpec.Region,
924+
Type: machineSpec.Type,
925+
AuthorizedKeys: machineSpec.AuthorizedKeys,
926+
AuthorizedUsers: machineSpec.AuthorizedUsers,
927+
RootPass: machineSpec.RootPass,
928+
Image: machineSpec.Image,
929+
Interfaces: interfaces,
930+
LinodeInterfaces: machineSpec.LinodeInterfaces,
931+
PrivateIP: privateIP,
932+
Tags: machineTags,
933+
FirewallID: machineSpec.FirewallID,
934+
DiskEncryption: linodego.InstanceDiskEncryption(machineSpec.DiskEncryption),
934935
}
935936
}
936937

0 commit comments

Comments
 (0)