You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: machine/v1beta1/types_awsprovider.go
+35-1Lines changed: 35 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -430,11 +430,13 @@ const (
430
430
431
431
// HostPlacement is the type that will be used to configure the placement of AWS instances.
432
432
// +kubebuilder:validation:XValidation:rule="has(self.affinity) && self.affinity == 'DedicatedHost' ? has(self.dedicatedHost) : true",message="dedicatedHost is required when affinity is DedicatedHost, and optional otherwise"
433
+
// +kubebuilder:validation:XValidation:rule="has(self.affinity) && has(self.dynamicHost) ? self.affinity == 'DynamicHost' : true",message="dynamicHost is only allowed when affinity is DynamicHost, and forbidden otherwise"
433
434
// +union
434
435
typeHostPlacementstruct {
435
436
// affinity specifies the affinity setting for the instance.
436
437
// Allowed values are AnyAvailable and DedicatedHost.
437
438
// When Affinity is set to DedicatedHost, an instance started onto a specific host always restarts on the same host if stopped. In this scenario, the `dedicatedHost` field must be set.
439
+
// When Affinity is set to DynamicHost, a dedicated host will be allocated and assigned to the instance and the instance will always restart on this host if stopped. In this scenario, the `dynamicHost` field may be set to provide additional settings.
438
440
// When Affinity is set to AnyAvailable, and you stop and restart the instance, it can be restarted on any available host.
439
441
// When Affinity is set to AnyAvailable and the `dedicatedHost` field is defined, it runs on specified Dedicated Host, but may move if stopped.
// DedicatedHost represents the configuration for the usage of dedicated host.
475
+
// +kubebuilder:validation:XValidation:rule="self.allocationStrategy == 'Provided' ? has(self.id) : true",message="id is required when allocationStrategy is Provided, and forbidden otherwise"
476
+
// +kubebuilder:validation:XValidation:rule="has(self.id) ? self.allocationStrategy == 'Provided' : true",message="id is required when allocationStrategy is Provided, and forbidden otherwise"
477
+
// +kubebuilder:validation:XValidation:rule="has(self.dynamicHostAllocation) ? self.allocationStrategy == 'Dynamic' : true",message="dynamicHostAllocation is only allowed when allocationStrategy is Dynamic"
464
478
typeDedicatedHoststruct {
479
+
// allocationStrategy specifies if the dedicated host will be provided by the admin through the id field or if the host
// id identifies the AWS Dedicated Host on which the instance must run.
466
485
// The value must start with "h-" followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f).
467
486
// The use of 8 lowercase hexadecimal characters is for older legacy hosts that may not have been migrated to newer format.
468
487
// Must be either 10 or 19 characters in length.
469
488
// +kubebuilder:validation:XValidation:rule="self.matches('^h-([0-9a-f]{8}|[0-9a-f]{17})$')",message="hostID must start with 'h-' followed by either 8 or 17 lowercase hexadecimal characters (0-9 and a-f)"
470
489
// +kubebuilder:validation:MinLength=10
471
490
// +kubebuilder:validation:MaxLength=19
472
-
// +required
491
+
// +optional
492
+
// +unionMember
473
493
IDstring`json:"id,omitempty"`
494
+
495
+
// dynamicHost enables automatic allocation of a single dedicated host.
496
+
// This field is mutually exclusive with dedicatedHost and always allocates exactly one host.
0 commit comments