Skip to content

Commit 4e16d97

Browse files
committed
fixup! build: Sync APIs
1 parent 6a66467 commit 4e16d97

File tree

4 files changed

+77
-4
lines changed

4 files changed

+77
-4
lines changed

api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmachine_types.go

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

2222
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
23-
"sigs.k8s.io/cluster-api/errors"
2423
)
2524

2625
const (
@@ -54,6 +53,16 @@ const (
5453
IgnitionStorageTypeOptionUnencryptedUserData = IgnitionStorageTypeOption("UnencryptedUserData")
5554
)
5655

56+
// NetworkInterfaceType is the type of network interface.
57+
type NetworkInterfaceType string
58+
59+
const (
60+
// NetworkInterfaceTypeENI means the network interface type is Elastic Network Interface.
61+
NetworkInterfaceTypeENI NetworkInterfaceType = NetworkInterfaceType("interface")
62+
// NetworkInterfaceTypeEFAWithENAInterface means the network interface type is Elastic Fabric Adapter with Elastic Network Adapter.
63+
NetworkInterfaceTypeEFAWithENAInterface NetworkInterfaceType = NetworkInterfaceType("efa")
64+
)
65+
5766
// AWSMachineSpec defines the desired state of an Amazon EC2 instance.
5867
type AWSMachineSpec struct {
5968
// ProviderID is the unique identifier as specified by the cloud provider.
@@ -153,6 +162,12 @@ type AWSMachineSpec struct {
153162
// +kubebuilder:validation:MaxItems=2
154163
NetworkInterfaces []string `json:"networkInterfaces,omitempty"`
155164

165+
// NetworkInterfaceType is the interface type of the primary network Interface.
166+
// If not specified, AWS applies a default value.
167+
// +kubebuilder:validation:Enum=interface;efa
168+
// +optional
169+
NetworkInterfaceType NetworkInterfaceType `json:"networkInterfaceType,omitempty"`
170+
156171
// UncompressedUserData specify whether the user data is gzip-compressed before it is sent to ec2 instance.
157172
// cloud-init has built-in support for gzip-compressed user data
158173
// user data stored in aws secret manager is always gzip-compressed.
@@ -197,6 +212,15 @@ type AWSMachineSpec struct {
197212
// CapacityReservationID specifies the target Capacity Reservation into which the instance should be launched.
198213
// +optional
199214
CapacityReservationID *string `json:"capacityReservationId,omitempty"`
215+
216+
// MarketType specifies the type of market for the EC2 instance. Valid values include:
217+
// "OnDemand" (default): The instance runs as a standard OnDemand instance.
218+
// "Spot": The instance runs as a Spot instance. When SpotMarketOptions is provided, the marketType defaults to "Spot".
219+
// "CapacityBlock": The instance utilizes pre-purchased compute capacity (capacity blocks) with AWS Capacity Reservations.
220+
// If this value is selected, CapacityReservationID must be specified to identify the target reservation.
221+
// If marketType is not specified and spotMarketOptions is provided, the marketType defaults to "Spot".
222+
// +optional
223+
MarketType MarketType `json:"marketType,omitempty"`
200224
}
201225

202226
// CloudInit defines options related to the bootstrapping systems where
@@ -352,7 +376,7 @@ type AWSMachineStatus struct {
352376
// can be added as events to the Machine object and/or logged in the
353377
// controller's output.
354378
// +optional
355-
FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"`
379+
FailureReason *string `json:"failureReason,omitempty"`
356380

357381
// FailureMessage will be set in the event that there is a terminal problem
358382
// reconciling the Machine and will contain a more verbose string suitable

api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/awsmanagedcluster_types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ type AWSManagedClusterStatus struct {
3838
// FailureDomains specifies a list fo available availability zones that can be used
3939
// +optional
4040
FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"`
41+
42+
// Conditions defines current service state of the AWSManagedCluster.
43+
// +optional
44+
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
4145
}
4246

4347
// +kubebuilder:object:root=true
@@ -69,3 +73,15 @@ type AWSManagedClusterList struct {
6973
func init() {
7074
SchemeBuilder.Register(&AWSManagedCluster{}, &AWSManagedClusterList{})
7175
}
76+
77+
// GetConditions returns the observations of the operational state of the
78+
// AWSManagedCluster resource.
79+
func (r *AWSManagedCluster) GetConditions() clusterv1.Conditions {
80+
return r.Status.Conditions
81+
}
82+
83+
// SetConditions sets the underlying service state of the AWSManagedCluster to
84+
// the predescribed clusterv1.Conditions.
85+
func (r *AWSManagedCluster) SetConditions(conditions clusterv1.Conditions) {
86+
r.Status.Conditions = conditions
87+
}

api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/types.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ type Instance struct {
217217
// Specifies ENIs attached to instance
218218
NetworkInterfaces []string `json:"networkInterfaces,omitempty"`
219219

220+
// NetworkInterfaceType is the interface type of the primary network Interface.
221+
NetworkInterfaceType NetworkInterfaceType `json:"networkInterfaceType,omitempty"`
222+
220223
// The tags associated with the instance.
221224
Tags map[string]string `json:"tags,omitempty"`
222225

@@ -261,8 +264,32 @@ type Instance struct {
261264
// CapacityReservationID specifies the target Capacity Reservation into which the instance should be launched.
262265
// +optional
263266
CapacityReservationID *string `json:"capacityReservationId,omitempty"`
267+
268+
// MarketType specifies the type of market for the EC2 instance. Valid values include:
269+
// "OnDemand" (default): The instance runs as a standard OnDemand instance.
270+
// "Spot": The instance runs as a Spot instance. When SpotMarketOptions is provided, the marketType defaults to "Spot".
271+
// "CapacityBlock": The instance utilizes pre-purchased compute capacity (capacity blocks) with AWS Capacity Reservations.
272+
// If this value is selected, CapacityReservationID must be specified to identify the target reservation.
273+
// If marketType is not specified and spotMarketOptions is provided, the marketType defaults to "Spot".
274+
// +optional
275+
MarketType MarketType `json:"marketType,omitempty"`
264276
}
265277

278+
// MarketType describes the market type of an Instance
279+
// +kubebuilder:validation:Enum:=OnDemand;Spot;CapacityBlock
280+
type MarketType string
281+
282+
const (
283+
// MarketTypeOnDemand is a MarketType enum value
284+
MarketTypeOnDemand MarketType = "OnDemand"
285+
286+
// MarketTypeSpot is a MarketType enum value
287+
MarketTypeSpot MarketType = "Spot"
288+
289+
// MarketTypeCapacityBlock is a MarketType enum value
290+
MarketTypeCapacityBlock MarketType = "CapacityBlock"
291+
)
292+
266293
// InstanceMetadataState describes the state of InstanceMetadataOptions.HttpEndpoint and InstanceMetadataOptions.InstanceMetadataTags
267294
type InstanceMetadataState string
268295

api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)