Skip to content

Commit

Permalink
Set lifecycle on WarmPool task
Browse files Browse the repository at this point in the history
  • Loading branch information
johngmyers committed May 29, 2021
1 parent 26309f0 commit 024b365
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 4 additions & 0 deletions cloudmock/aws/mockautoscaling/warmpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ func (m *MockAutoscaling) DescribeWarmPool(input *autoscaling.DescribeWarmPoolIn
}
return ret, nil
}

func (m *MockAutoscaling) DeleteWarmPool(*autoscaling.DeleteWarmPoolInput) (*autoscaling.DeleteWarmPoolOutput, error) {
return &autoscaling.DeleteWarmPoolOutput{}, nil
}
5 changes: 3 additions & 2 deletions pkg/model/awsmodel/autoscalinggroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ func (b *AutoscalingGroupModelBuilder) Build(c *fi.ModelBuilderContext) error {
{
enabled := fi.Bool(warmPool.IsEnabled())
warmPoolTask := &awstasks.WarmPool{
Name: &name,
Enabled: enabled,
Name: &name,
Lifecycle: b.Lifecycle,
Enabled: enabled,
}
if warmPool.IsEnabled() {
warmPoolTask.MinSize = warmPool.MinSize
Expand Down
14 changes: 8 additions & 6 deletions upup/pkg/fi/cloudup/awstasks/warmpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,18 @@ func (e *WarmPool) Find(c *fi.Context) (*WarmPool, error) {
}
if warmPool.WarmPoolConfiguration == nil {
return &WarmPool{
Name: e.Name,
Enabled: fi.Bool(false),
Name: e.Name,
Lifecycle: e.Lifecycle,
Enabled: fi.Bool(false),
}, nil
}

actual := &WarmPool{
Name: e.Name,
Enabled: fi.Bool(true),
MaxSize: warmPool.WarmPoolConfiguration.MaxGroupPreparedCapacity,
MinSize: fi.Int64Value(warmPool.WarmPoolConfiguration.MinSize),
Name: e.Name,
Lifecycle: e.Lifecycle,
Enabled: fi.Bool(true),
MaxSize: warmPool.WarmPoolConfiguration.MaxGroupPreparedCapacity,
MinSize: fi.Int64Value(warmPool.WarmPoolConfiguration.MinSize),
}
return actual, nil
}
Expand Down

0 comments on commit 024b365

Please sign in to comment.