Skip to content

Commit

Permalink
Merge pull request #3816 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…3743-to-release-1.5

[release-1.5] Add ASG Instance AZ SDK API to CAPA API conversion
  • Loading branch information
k8s-ci-robot committed Nov 7, 2022
2 parents 4d83291 + 4355402 commit 1f66f27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pkg/cloud/services/autoscaling/autoscalinggroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ func (s *Service) SDKToAutoScalingGroup(v *autoscaling.Group) (*expinfrav1.AutoS
if len(v.Instances) > 0 {
for _, autoscalingInstance := range v.Instances {
tmp := &infrav1.Instance{
ID: aws.StringValue(autoscalingInstance.InstanceId),
State: infrav1.InstanceState(*autoscalingInstance.LifecycleState),
ID: aws.StringValue(autoscalingInstance.InstanceId),
State: infrav1.InstanceState(*autoscalingInstance.LifecycleState),
AvailabilityZone: *autoscalingInstance.AvailabilityZone,
}
i.Instances = append(i.Instances, *tmp)
}
Expand Down
10 changes: 6 additions & 4 deletions pkg/cloud/services/autoscaling/autoscalinggroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ func TestService_SDKToAutoScalingGroup(t *testing.T) {
},
Instances: []*autoscaling.Instance{
{
InstanceId: aws.String("instanceId"),
LifecycleState: aws.String("lifecycleState"),
InstanceId: aws.String("instanceId"),
LifecycleState: aws.String("lifecycleState"),
AvailabilityZone: aws.String("us-east-1a"),
},
},
},
Expand Down Expand Up @@ -249,8 +250,9 @@ func TestService_SDKToAutoScalingGroup(t *testing.T) {
},
Instances: []infrav1.Instance{
{
ID: "instanceId",
State: "lifecycleState",
ID: "instanceId",
State: "lifecycleState",
AvailabilityZone: "us-east-1a",
},
},
},
Expand Down

0 comments on commit 1f66f27

Please sign in to comment.