Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions upup/pkg/fi/cloudup/awstasks/warmpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,28 @@ type WarmPool struct {
AutoscalingGroup *AutoscalingGroup
}

var _ fi.CloudupHasDependencies = &WarmPool{}

// Warmpool depends on any Lifecycle hooks being in place first.
func (e *WarmPool) GetDependencies(tasks map[string]fi.CloudupTask) []fi.CloudupTask {
var deps []fi.CloudupTask

// Depend on the ASG.
if e.AutoscalingGroup != nil {
deps = append(deps, e.AutoscalingGroup)
}

// Depend on any Lifecycle hooks assigned to the ASG.
for _, task := range tasks {
if l, ok := task.(*AutoscalingLifecycleHook); ok {
if l.AutoscalingGroup == e.AutoscalingGroup {
deps = append(deps, task)
}
}
}
return deps
}

// Find is used to discover the ASG in the cloud provider.
func (e *WarmPool) Find(c *fi.CloudupContext) (*WarmPool, error) {
ctx := c.Context()
Expand Down