Skip to content

Commit bc23ec5

Browse files
committed
correct linter errors
1 parent a2d76a7 commit bc23ec5

File tree

5 files changed

+7
-42
lines changed

5 files changed

+7
-42
lines changed

api/v1beta2/awsmachine_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ type AWSMachineSpec struct {
247247
HostAffinity *string `json:"hostAffinity,omitempty"`
248248

249249
// CapacityReservationPreference specifies the preference for use of Capacity Reservations by the instance. Valid values include:
250-
// "Open" (default): The instance may make make use of open Capacity Reservations that match its AZ and InstanceType
250+
// "Open" (default): The instance may make use of open Capacity Reservations that match its AZ and InstanceType
251251
// "None": The instance may not make use of any Capacity Reservations. This is to conserve open reservations for desired workloads
252252
// "CapacityReservationsOnly": The instance will only run if matched or targeted to a Capacity Reservation
253253
// +optional

api/v1beta2/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ type Instance struct {
287287
HostID *string `json:"hostID,omitempty"`
288288

289289
// CapacityReservationPreference specifies the preference for use of Capacity Reservations by the instance. Valid values include:
290-
// "Open" (default): The instance may make make use of open Capacity Reservations that match its AZ and InstanceType
290+
// "Open" (default): The instance may make use of open Capacity Reservations that match its AZ and InstanceType
291291
// "None": The instance may not make use of any Capacity Reservations. This is to conserve open reservations for desired workloads
292292
// "CapacityReservationsOnly": The instance will only run if matched or targeted to a Capacity Reservation
293293
// +optional

exp/api/v1beta2/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ type AWSLaunchTemplate struct {
148148
MarketType infrav1.MarketType `json:"marketType,omitempty"`
149149

150150
// CapacityReservationPreference specifies the preference for use of Capacity Reservations by the instance. Valid values include:
151-
// "Open" (default): The instance may make make use of open Capacity Reservations that match its AZ and InstanceType
151+
// "Open" (default): The instance may make use of open Capacity Reservations that match its AZ and InstanceType
152152
// "None": The instance may not make use of any Capacity Reservations. This is to conserve open reservations for desired workloads
153153
// "CapacityReservationsOnly": The instance will only run if matched or targeted to a Capacity Reservation
154154
// +optional

pkg/cloud/services/ec2/helper_test.go

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -61,45 +61,6 @@ func setupMachinePoolScope(cl client.Client, ec2Scope scope.EC2Scope) (*scope.Ma
6161
})
6262
}
6363

64-
func setupCapacityBlocksMachinePoolScope(cl client.Client, ec2Scope scope.EC2Scope) (*scope.MachinePoolScope, error) {
65-
return scope.NewMachinePoolScope(scope.MachinePoolScopeParams{
66-
Client: cl,
67-
InfraCluster: ec2Scope,
68-
Cluster: newCluster(),
69-
MachinePool: newMachinePool(),
70-
AWSMachinePool: newAWSCapacityBlockMachinePool(),
71-
})
72-
}
73-
74-
func newAWSCapacityBlockMachinePool() *expinfrav1.AWSMachinePool {
75-
return &expinfrav1.AWSMachinePool{
76-
TypeMeta: metav1.TypeMeta{
77-
Kind: "AWSMachinePool",
78-
APIVersion: "v1",
79-
},
80-
ObjectMeta: metav1.ObjectMeta{
81-
Name: "aws-mp-name",
82-
Namespace: "aws-mp-ns",
83-
},
84-
Spec: expinfrav1.AWSMachinePoolSpec{
85-
AvailabilityZones: []string{"us-east-1"},
86-
AdditionalTags: infrav1.Tags{},
87-
AWSLaunchTemplate: expinfrav1.AWSLaunchTemplate{
88-
Name: "aws-launch-template",
89-
IamInstanceProfile: "instance-profile",
90-
AMI: infrav1.AMIReference{},
91-
InstanceType: "t3.large",
92-
SSHKeyName: aws.String("default"),
93-
MarketType: infrav1.MarketTypeCapacityBlock,
94-
CapacityReservationID: aws.String("cr-12345678901234567"),
95-
},
96-
},
97-
Status: expinfrav1.AWSMachinePoolStatus{
98-
LaunchTemplateID: "launch-template-id",
99-
},
100-
}
101-
}
102-
10364
func defaultEC2Tags(name, clusterName string) []types.Tag {
10465
return []types.Tag{
10566
{

pkg/cloud/services/ec2/launchtemplate.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,8 @@ func SDKToSpotMarketOptions(instanceMarketOptions *types.LaunchTemplateInstanceM
848848
return result
849849
}
850850

851+
// SDKToCapacityReservationPreference maps an AWS SDK Capacity Reservation Preference onto the CAPA internal CapacityReservationPreference type.
852+
// inverse to `CapacityReservationPreferenceToSDK`.
851853
func SDKToCapacityReservationPreference(preference types.CapacityReservationPreference) infrav1.CapacityReservationPreference {
852854
switch preference {
853855
case types.CapacityReservationPreferenceCapacityReservationsOnly:
@@ -861,6 +863,8 @@ func SDKToCapacityReservationPreference(preference types.CapacityReservationPref
861863
}
862864
}
863865

866+
// CapacityReservationPreferenceToSDK maps a CAPA internal Capacity Reservation Preference enum type onto the AWS SDK equivalent.
867+
// inverse to `SDKToCapacityReservationPreference`.
864868
func CapacityReservationPreferenceToSDK(preference infrav1.CapacityReservationPreference) types.CapacityReservationPreference {
865869
switch preference {
866870
case infrav1.CapacityReservationPreferenceNone:

0 commit comments

Comments
 (0)