Merge pull request #15722 from rifelpet/fix-warmpool

Fix WarmPool with --target direct
This commit is contained in:
Kubernetes Prow Robot 2023-07-30 10:32:04 -07:00 committed by GitHub
commit bfefb0cd97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

View File

@ -110,6 +110,31 @@ func (e *AutoscalingGroup) CompareWithID() *string {
return e.Name return e.Name
} }
// Track dependencies here to explicitly ignore WarmPool
// because the WarmPool should be created after the ASG, not the other way around.
// The WarmPool struct field is only used for RenderTerraform.
func (e *AutoscalingGroup) GetDependencies(tasks map[string]fi.CloudupTask) []fi.CloudupTask {
var deps []fi.CloudupTask
for _, lb := range e.LoadBalancers {
deps = append(deps, lb)
}
for _, tg := range e.TargetGroups {
deps = append(deps, tg)
}
for _, subnet := range e.Subnets {
deps = append(deps, subnet)
}
if e.LaunchTemplate != nil {
deps = append(deps, e.LaunchTemplate)
}
return deps
}
// Find is used to discover the ASG in the cloud provider // Find is used to discover the ASG in the cloud provider
func (e *AutoscalingGroup) Find(c *fi.CloudupContext) (*AutoscalingGroup, error) { func (e *AutoscalingGroup) Find(c *fi.CloudupContext) (*AutoscalingGroup, error) {
cloud := c.T.Cloud.(awsup.AWSCloud) cloud := c.T.Cloud.(awsup.AWSCloud)