Skip to content

Commit b94b972

Browse files
committed
remove struct duplication from linodego now that opinters are used everywhere so deepcopy generation works properly
1 parent 463f60c commit b94b972

File tree

6 files changed

+66
-1045
lines changed

6 files changed

+66
-1045
lines changed

api/v1beta1/linodecluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ type NodeBalancerConfig struct {
252252
}
253253

254254
type LinodeNBPortConfig struct {
255-
// port configured on the NodeBalancer. It must be valid port range (1-65535).
255+
// Port configured on the NodeBalancer. It must be valid port range (1-65535).
256256
// +kubebuilder:validation:Minimum=1
257257
// +kubebuilder:validation:Maximum=65535
258258
// +required

api/v1beta1/linodemachine_types.go

Lines changed: 2 additions & 231 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ type LinodeMachineSpec struct {
173173
// +optional
174174
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
175175
// +listType=atomic
176-
Interfaces []InstanceConfigInterfaceCreateOptions `json:"interfaces,omitempty"`
176+
Interfaces []linodego.InstanceConfigInterfaceCreateOptions `json:"interfaces,omitempty"`
177177

178178
// LinodeInterfaces is a list of Linode network interfaces to use for the instance. Requires Linode Interfaces beta opt-in to use.
179179
// Conflicts with Interfaces.
180180
// +optional
181181
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
182182
// +kubebuilder:object:generate=true
183183
// +listType=atomic
184-
LinodeInterfaces []LinodeInterfaceCreateOptions `json:"linodeInterfaces,omitempty"`
184+
LinodeInterfaces []linodego.LinodeInterfaceCreateOptions `json:"linodeInterfaces,omitempty"`
185185

186186
// diskEncryption determines if the disks of the instance should be encrypted. The default is disabled.
187187
// +optional
@@ -268,235 +268,6 @@ type InstanceMetadataOptions struct {
268268
UserData string `json:"userData,omitempty"`
269269
}
270270

271-
// InstanceConfigInterfaceCreateOptions defines network interface config
272-
type InstanceConfigInterfaceCreateOptions struct {
273-
// ipamAddress is the IP address to assign to the interface.
274-
// +optional
275-
IPAMAddress string `json:"ipamAddress,omitempty"`
276-
277-
// label is the label of the interface.
278-
// +kubebuilder:validation:MinLength=3
279-
// +kubebuilder:validation:MaxLength=63
280-
// +optional
281-
Label string `json:"label,omitempty"`
282-
283-
// purpose is the purpose of the interface.
284-
// +optional
285-
Purpose linodego.ConfigInterfacePurpose `json:"purpose,omitempty"`
286-
287-
// primary is a boolean indicating whether the interface is primary.
288-
// +optional
289-
Primary bool `json:"primary,omitempty"`
290-
291-
// subnetId is the ID of the subnet to use for the interface.
292-
// +optional
293-
SubnetID *int `json:"subnetId,omitempty"`
294-
295-
// ipv4 is the IPv4 configuration for the interface.
296-
// +optional
297-
IPv4 *VPCIPv4 `json:"ipv4,omitempty"`
298-
299-
// ipRanges is a list of IPv4 ranges to assign to the interface.
300-
// +optional
301-
// +listType=set
302-
IPRanges []string `json:"ipRanges,omitempty"`
303-
}
304-
305-
// LinodeInterfaceCreateOptions defines the linode network interface config
306-
type LinodeInterfaceCreateOptions struct {
307-
// firewallID is the ID of the firewall to use for the interface.
308-
// +optional
309-
FirewallID *int `json:"firewallID,omitempty"`
310-
311-
// defaultRoute is the default route for the interface.
312-
// +optional
313-
DefaultRoute *InterfaceDefaultRoute `json:"defaultRoute,omitempty"`
314-
315-
// public is the public interface configuration for the interface.
316-
// +optional
317-
Public *PublicInterfaceCreateOptions `json:"public,omitempty"`
318-
319-
// vpc is the VPC interface configuration for the interface.
320-
// +optional
321-
VPC *VPCInterfaceCreateOptions `json:"vpc,omitempty"`
322-
323-
// vlan is the VLAN interface configuration for the interface.
324-
// +optional
325-
VLAN *VLANInterface `json:"vlan,omitempty"`
326-
}
327-
328-
// InterfaceDefaultRoute defines the default IPv4 and IPv6 routes for an interface
329-
type InterfaceDefaultRoute struct {
330-
// ipv4 is the IPv4 default route for the interface.
331-
// +optional
332-
IPv4 *bool `json:"ipv4,omitempty"`
333-
334-
// ipv6 is the IPv6 default route for the interface.
335-
// +optional
336-
IPv6 *bool `json:"ipv6,omitempty"`
337-
}
338-
339-
// PublicInterfaceCreateOptions defines the IPv4 and IPv6 public interface create options
340-
type PublicInterfaceCreateOptions struct {
341-
// ipv4 is the IPv4 configuration for the public interface.
342-
// +optional
343-
IPv4 *PublicInterfaceIPv4CreateOptions `json:"ipv4,omitempty"`
344-
345-
// ipv6 is the IPv6 configuration for the public interface.
346-
// +optional
347-
IPv6 *PublicInterfaceIPv6CreateOptions `json:"ipv6,omitempty"`
348-
}
349-
350-
// PublicInterfaceIPv4CreateOptions defines the PublicInterfaceIPv4AddressCreateOptions for addresses
351-
type PublicInterfaceIPv4CreateOptions struct {
352-
// addresses is the IPv4 addresses for the public interface.
353-
// +optional
354-
// +listType=map
355-
// +listMapKey=address
356-
Addresses []PublicInterfaceIPv4AddressCreateOptions `json:"addresses,omitempty"`
357-
}
358-
359-
// PublicInterfaceIPv4AddressCreateOptions defines the public IPv4 address and whether it is primary
360-
type PublicInterfaceIPv4AddressCreateOptions struct {
361-
// address is the IPv4 address for the public interface.
362-
// +kubebuilder:validation:MinLength=1
363-
// +required
364-
Address string `json:"address,omitempty"`
365-
366-
// primary is a boolean indicating whether the address is primary.
367-
// +optional
368-
Primary *bool `json:"primary,omitempty"`
369-
}
370-
371-
// PublicInterfaceIPv6CreateOptions defines the PublicInterfaceIPv6RangeCreateOptions
372-
type PublicInterfaceIPv6CreateOptions struct {
373-
// ranges is the IPv6 ranges for the public interface.
374-
// +optional
375-
// +listType=map
376-
// +listMapKey=range
377-
Ranges []PublicInterfaceIPv6RangeCreateOptions `json:"ranges,omitempty"`
378-
}
379-
380-
// PublicInterfaceIPv6RangeCreateOptions defines the IPv6 range for a public interface
381-
type PublicInterfaceIPv6RangeCreateOptions struct {
382-
// range is the IPv6 range for the public interface.
383-
// +kubebuilder:validation:MinLength=1
384-
// +required
385-
Range string `json:"range,omitempty"`
386-
}
387-
388-
// VPCInterfaceCreateOptions defines the VPC interface configuration for an instance
389-
type VPCInterfaceCreateOptions struct {
390-
// subnetId is the ID of the subnet to use for the interface.
391-
// +optional
392-
SubnetID *int `json:"subnetId,omitempty"`
393-
394-
// ipv4 is the IPv4 configuration for the interface.
395-
// +optional
396-
IPv4 *VPCInterfaceIPv4CreateOptions `json:"ipv4,omitempty"`
397-
398-
// ipv6 is the IPv6 configuration for the interface.
399-
// +optional
400-
IPv6 *VPCInterfaceIPv6CreateOptions `json:"ipv6,omitempty"`
401-
}
402-
403-
// VPCInterfaceIPv6CreateOptions defines the IPv6 configuration for a VPC interface
404-
type VPCInterfaceIPv6CreateOptions struct {
405-
// slaac is the IPv6 SLAAC configuration for the interface.
406-
// +optional
407-
// +listType=map
408-
// +listMapKey=range
409-
SLAAC []VPCInterfaceIPv6SLAACCreateOptions `json:"slaac,omitempty"`
410-
411-
// ranges is the IPv6 ranges for the interface.
412-
// +optional
413-
// +listType=map
414-
// +listMapKey=range
415-
Ranges []VPCInterfaceIPv6RangeCreateOptions `json:"ranges,omitempty"`
416-
417-
// isPublic is a boolean indicating whether the interface is public.
418-
// +required
419-
IsPublic *bool `json:"isPublic,omitempty"`
420-
}
421-
422-
// VPCInterfaceIPv6SLAACCreateOptions defines the Range for IPv6 SLAAC
423-
type VPCInterfaceIPv6SLAACCreateOptions struct {
424-
// range is the IPv6 range for the interface.
425-
// +kubebuilder:validation:MinLength=1
426-
// +required
427-
Range string `json:"range,omitempty"`
428-
}
429-
430-
// VPCInterfaceIPv6RangeCreateOptions defines the IPv6 range for a VPC interface
431-
type VPCInterfaceIPv6RangeCreateOptions struct {
432-
// range is the IPv6 range for the interface.
433-
// +kubebuilder:validation:MinLength=1
434-
// +required
435-
Range string `json:"range,omitempty"`
436-
}
437-
438-
// VPCInterfaceIPv4CreateOptions defines the IPv4 address and range configuration for a VPC interface
439-
type VPCInterfaceIPv4CreateOptions struct {
440-
// addresses is the IPv4 addresses for the interface.
441-
// +optional
442-
// +listType=map
443-
// +listMapKey=address
444-
Addresses []VPCInterfaceIPv4AddressCreateOptions `json:"addresses,omitempty"`
445-
446-
// ranges is the IPv4 ranges for the interface.
447-
// +optional
448-
// +listType=map
449-
// +listMapKey=range
450-
Ranges []VPCInterfaceIPv4RangeCreateOptions `json:"ranges,omitempty"`
451-
}
452-
453-
// VPCInterfaceIPv4AddressCreateOptions defines the IPv4 configuration for a VPC interface
454-
type VPCInterfaceIPv4AddressCreateOptions struct {
455-
// address is the IPv4 address for the interface.
456-
// +kubebuilder:validation:MinLength=1
457-
// +required
458-
Address string `json:"address,omitempty"`
459-
460-
// primary is a boolean indicating whether the address is primary.
461-
// +optional
462-
Primary *bool `json:"primary,omitempty"`
463-
464-
// nat1to1Address is the NAT 1:1 address for the interface.
465-
// +optional
466-
NAT1To1Address *string `json:"nat1to1Address,omitempty"`
467-
}
468-
469-
// VPCInterfaceIPv4RangeCreateOptions defines the IPv4 range for a VPC interface
470-
type VPCInterfaceIPv4RangeCreateOptions struct {
471-
// range is the IPv4 range for the interface.
472-
// +kubebuilder:validation:MinLength=1
473-
// +required
474-
Range string `json:"range,omitempty"`
475-
}
476-
477-
// VLANInterface defines the VLAN interface configuration for an instance
478-
type VLANInterface struct {
479-
// vlanLabel is the label of the VLAN.
480-
// +kubebuilder:validation:MinLength=1
481-
// +required
482-
VLANLabel string `json:"vlanLabel,omitempty"`
483-
484-
// ipamAddress is the IP address to assign to the interface.
485-
// +optional
486-
IPAMAddress *string `json:"ipamAddress,omitempty"`
487-
}
488-
489-
// VPCIPv4 defines VPC IPV4 settings
490-
type VPCIPv4 struct {
491-
// vpc is the ID of the VPC to use for the interface.
492-
// +optional
493-
VPC string `json:"vpc,omitempty"`
494-
495-
// nat1to1 is the NAT 1:1 address for the interface.
496-
// +optional
497-
NAT1To1 string `json:"nat1to1,omitempty"`
498-
}
499-
500271
// LinodeMachineStatus defines the observed state of LinodeMachine
501272
type LinodeMachineStatus struct {
502273
// conditions define the current service state of the LinodeMachine.

0 commit comments

Comments
 (0)