Skip to content

Commit b33e4f7

Browse files
authored
Merge pull request #3743 from Ankitasw/asg-instance-az
Add ASG Instance AZ SDK API to CAPA API conversion
2 parents 9e71830 + 54d7194 commit b33e4f7

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

pkg/cloud/services/autoscaling/autoscalinggroup.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ func (s *Service) SDKToAutoScalingGroup(v *autoscaling.Group) (*expinfrav1.AutoS
8383
if len(v.Instances) > 0 {
8484
for _, autoscalingInstance := range v.Instances {
8585
tmp := &infrav1.Instance{
86-
ID: aws.StringValue(autoscalingInstance.InstanceId),
87-
State: infrav1.InstanceState(*autoscalingInstance.LifecycleState),
86+
ID: aws.StringValue(autoscalingInstance.InstanceId),
87+
State: infrav1.InstanceState(*autoscalingInstance.LifecycleState),
88+
AvailabilityZone: *autoscalingInstance.AvailabilityZone,
8889
}
8990
i.Instances = append(i.Instances, *tmp)
9091
}

pkg/cloud/services/autoscaling/autoscalinggroup_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,9 @@ func TestServiceSDKToAutoScalingGroup(t *testing.T) {
218218
},
219219
Instances: []*autoscaling.Instance{
220220
{
221-
InstanceId: aws.String("instanceId"),
222-
LifecycleState: aws.String("lifecycleState"),
221+
InstanceId: aws.String("instanceId"),
222+
LifecycleState: aws.String("lifecycleState"),
223+
AvailabilityZone: aws.String("us-east-1a"),
223224
},
224225
},
225226
},
@@ -249,8 +250,9 @@ func TestServiceSDKToAutoScalingGroup(t *testing.T) {
249250
},
250251
Instances: []infrav1.Instance{
251252
{
252-
ID: "instanceId",
253-
State: "lifecycleState",
253+
ID: "instanceId",
254+
State: "lifecycleState",
255+
AvailabilityZone: "us-east-1a",
254256
},
255257
},
256258
},

0 commit comments

Comments
 (0)