Skip to content

Commit 6ad02ef

Browse files
authored
Merge pull request #5047 from athiruma/support_capacity_reservation
✨ Added the CapacityReservation support
2 parents 0159435 + 5e44fa5 commit 6ad02ef

12 files changed

+92
-0
lines changed

api/v1beta1/awscluster_conversion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func (src *AWSCluster) ConvertTo(dstRaw conversion.Hub) error {
5959
dst.Status.Bastion.PlacementGroupPartition = restored.Status.Bastion.PlacementGroupPartition
6060
dst.Status.Bastion.PrivateDNSName = restored.Status.Bastion.PrivateDNSName
6161
dst.Status.Bastion.PublicIPOnLaunch = restored.Status.Bastion.PublicIPOnLaunch
62+
dst.Status.Bastion.CapacityReservationID = restored.Status.Bastion.CapacityReservationID
6263
}
6364
dst.Spec.Partition = restored.Spec.Partition
6465

api/v1beta1/awsmachine_conversion.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func (src *AWSMachine) ConvertTo(dstRaw conversion.Hub) error {
4141
dst.Spec.PlacementGroupPartition = restored.Spec.PlacementGroupPartition
4242
dst.Spec.PrivateDNSName = restored.Spec.PrivateDNSName
4343
dst.Spec.SecurityGroupOverrides = restored.Spec.SecurityGroupOverrides
44+
dst.Spec.CapacityReservationID = restored.Spec.CapacityReservationID
4445
if restored.Spec.ElasticIPPool != nil {
4546
if dst.Spec.ElasticIPPool == nil {
4647
dst.Spec.ElasticIPPool = &infrav1.ElasticIPPool{}
@@ -102,6 +103,7 @@ func (r *AWSMachineTemplate) ConvertTo(dstRaw conversion.Hub) error {
102103
dst.Spec.Template.Spec.PlacementGroupPartition = restored.Spec.Template.Spec.PlacementGroupPartition
103104
dst.Spec.Template.Spec.PrivateDNSName = restored.Spec.Template.Spec.PrivateDNSName
104105
dst.Spec.Template.Spec.SecurityGroupOverrides = restored.Spec.Template.Spec.SecurityGroupOverrides
106+
dst.Spec.Template.Spec.CapacityReservationID = restored.Spec.Template.Spec.CapacityReservationID
105107
if restored.Spec.Template.Spec.ElasticIPPool != nil {
106108
if dst.Spec.Template.Spec.ElasticIPPool == nil {
107109
dst.Spec.Template.Spec.ElasticIPPool = &infrav1.ElasticIPPool{}

api/v1beta1/zz_generated.conversion.go

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

api/v1beta2/awsmachine_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ type AWSMachineSpec struct {
193193
// PrivateDNSName is the options for the instance hostname.
194194
// +optional
195195
PrivateDNSName *PrivateDNSName `json:"privateDnsName,omitempty"`
196+
197+
// CapacityReservationID specifies the target Capacity Reservation into which the instance should be launched.
198+
// +optional
199+
CapacityReservationID *string `json:"capacityReservationId,omitempty"`
196200
}
197201

198202
// CloudInit defines options related to the bootstrapping systems where

api/v1beta2/types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ type Instance struct {
251251
// PublicIPOnLaunch is the option to associate a public IP on instance launch
252252
// +optional
253253
PublicIPOnLaunch *bool `json:"publicIPOnLaunch,omitempty"`
254+
255+
// CapacityReservationID specifies the target Capacity Reservation into which the instance should be launched.
256+
// +optional
257+
CapacityReservationID *string `json:"capacityReservationId,omitempty"`
254258
}
255259

256260
// InstanceMetadataState describes the state of InstanceMetadataOptions.HttpEndpoint and InstanceMetadataOptions.InstanceMetadataTags

api/v1beta2/zz_generated.deepcopy.go

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

config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,10 @@ spec:
11021102
availabilityZone:
11031103
description: Availability zone of instance
11041104
type: string
1105+
capacityReservationId:
1106+
description: CapacityReservationID specifies the target Capacity
1107+
Reservation into which the instance should be launched.
1108+
type: string
11051109
ebsOptimized:
11061110
description: Indicates whether the instance is optimized for Amazon
11071111
EBS I/O.
@@ -3118,6 +3122,10 @@ spec:
31183122
availabilityZone:
31193123
description: Availability zone of instance
31203124
type: string
3125+
capacityReservationId:
3126+
description: CapacityReservationID specifies the target Capacity
3127+
Reservation into which the instance should be launched.
3128+
type: string
31213129
ebsOptimized:
31223130
description: Indicates whether the instance is optimized for Amazon
31233131
EBS I/O.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,6 +2087,10 @@ spec:
20872087
availabilityZone:
20882088
description: Availability zone of instance
20892089
type: string
2090+
capacityReservationId:
2091+
description: CapacityReservationID specifies the target Capacity
2092+
Reservation into which the instance should be launched.
2093+
type: string
20902094
ebsOptimized:
20912095
description: Indicates whether the instance is optimized for Amazon
20922096
EBS I/O.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,10 @@ spec:
624624
description: ID of resource
625625
type: string
626626
type: object
627+
capacityReservationId:
628+
description: CapacityReservationID specifies the target Capacity Reservation
629+
into which the instance should be launched.
630+
type: string
627631
cloudInit:
628632
description: |-
629633
CloudInit defines options related to the bootstrapping systems where

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,10 @@ spec:
554554
description: ID of resource
555555
type: string
556556
type: object
557+
capacityReservationId:
558+
description: CapacityReservationID specifies the target Capacity
559+
Reservation into which the instance should be launched.
560+
type: string
557561
cloudInit:
558562
description: |-
559563
CloudInit defines options related to the bootstrapping systems where

0 commit comments

Comments
 (0)