@@ -42,14 +42,16 @@ type LinodeMachineSpec struct {
4242 InstanceID * int `json:"instanceID,omitempty"`
4343
4444 // region is the Linode region to create the instance in.
45+ // +kubebuilder:validation:MinLength=1
4546 // +required
4647 // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
47- Region string `json:"region"`
48+ Region string `json:"region,omitempty "`
4849
4950 // type is the Linode instance type to create.
51+ // +kubebuilder:validation:MinLength=1
5052 // +required
5153 // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
52- Type string `json:"type"`
54+ Type string `json:"type,omitempty "`
5355
5456 // group is the Linode group to create the instance in.
5557 // +optional
@@ -364,8 +366,9 @@ type PublicInterfaceIPv4CreateOptions struct {
364366// PublicInterfaceIPv4AddressCreateOptions defines the public IPv4 address and whether it is primary
365367type PublicInterfaceIPv4AddressCreateOptions struct {
366368 // address is the IPv4 address for the public interface.
369+ // +kubebuilder:validation:MinLength=1
367370 // +required
368- Address string `json:"address"`
371+ Address string `json:"address,omitempty "`
369372
370373 // primary is a boolean indicating whether the address is primary.
371374 // +optional
@@ -384,15 +387,17 @@ type PublicInterfaceIPv6CreateOptions struct {
384387// PublicInterfaceIPv6RangeCreateOptions defines the IPv6 range for a public interface
385388type PublicInterfaceIPv6RangeCreateOptions struct {
386389 // range is the IPv6 range for the public interface.
390+ // +kubebuilder:validation:MinLength=1
387391 // +required
388- Range string `json:"range"`
392+ Range string `json:"range,omitempty "`
389393}
390394
391395// VPCInterfaceCreateOptions defines the VPC interface configuration for an instance
392396type VPCInterfaceCreateOptions struct {
393397 // subnet_id is the ID of the subnet to use for the interface.
398+ // +kubebuilder:validation:Minimum=1
394399 // +required
395- SubnetID int `json:"subnet_id"`
400+ SubnetID int `json:"subnet_id,omitempty "`
396401
397402 // ipv4 is the IPv4 configuration for the interface.
398403 // +optional
@@ -419,21 +424,23 @@ type VPCInterfaceIPv6CreateOptions struct {
419424
420425 // is_public is a boolean indicating whether the interface is public.
421426 // +required
422- IsPublic bool `json:"is_public"`
427+ IsPublic * bool `json:"is_public,omitempty "`
423428}
424429
425430// VPCInterfaceIPv6SLAACCreateOptions defines the Range for IPv6 SLAAC
426431type VPCInterfaceIPv6SLAACCreateOptions struct {
427432 // range is the IPv6 range for the interface.
433+ // +kubebuilder:validation:MinLength=1
428434 // +required
429- Range string `json:"range"`
435+ Range string `json:"range,omitempty "`
430436}
431437
432438// VPCInterfaceIPv6RangeCreateOptions defines the IPv6 range for a VPC interface
433439type VPCInterfaceIPv6RangeCreateOptions struct {
434440 // range is the IPv6 range for the interface.
441+ // +kubebuilder:validation:MinLength=1
435442 // +required
436- Range string `json:"range"`
443+ Range string `json:"range,omitempty "`
437444}
438445
439446// VPCInterfaceIPv4CreateOptions defines the IPv4 address and range configuration for a VPC interface
@@ -454,8 +461,9 @@ type VPCInterfaceIPv4CreateOptions struct {
454461// VPCInterfaceIPv4AddressCreateOptions defines the IPv4 configuration for a VPC interface
455462type VPCInterfaceIPv4AddressCreateOptions struct {
456463 // address is the IPv4 address for the interface.
464+ // +kubebuilder:validation:MinLength=1
457465 // +required
458- Address string `json:"address"`
466+ Address string `json:"address,omitempty "`
459467
460468 // primary is a boolean indicating whether the address is primary.
461469 // +optional
@@ -469,15 +477,17 @@ type VPCInterfaceIPv4AddressCreateOptions struct {
469477// VPCInterfaceIPv4RangeCreateOptions defines the IPv4 range for a VPC interface
470478type VPCInterfaceIPv4RangeCreateOptions struct {
471479 // range is the IPv4 range for the interface.
480+ // +kubebuilder:validation:MinLength=1
472481 // +required
473- Range string `json:"range"`
482+ Range string `json:"range,omitempty "`
474483}
475484
476485// VLANInterface defines the VLAN interface configuration for an instance
477486type VLANInterface struct {
478487 // vlan_label is the label of the VLAN.
488+ // +kubebuilder:validation:MinLength=1
479489 // +required
480- VLANLabel string `json:"vlan_label"`
490+ VLANLabel string `json:"vlan_label,omitempty "`
481491
482492 // ipam_address is the IP address to assign to the interface.
483493 // +optional
@@ -589,8 +599,8 @@ type LinodeMachine struct {
589599 metav1.ObjectMeta `json:"metadata,omitempty"`
590600
591601 // spec defines the specification of desired behavior for the LinodeMachine.
592- // +optional
593- Spec LinodeMachineSpec `json:"spec,omitempty"`
602+ // +required
603+ Spec LinodeMachineSpec `json:"spec,omitzero, omitempty"`
594604
595605 // status defines the observed state of LinodeMachine.
596606 // +optional
0 commit comments