Skip to content

Commit

Permalink
🐛 ensure we do not send double assets in (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeffrey authored Jan 31, 2023
1 parent 57014f1 commit 43fe271
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion motor/discovery/aws/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,17 @@ func (r *Resolver) Resolve(ctx context.Context, root *asset.Asset, tc *providers
}
}

return resolved, nil
assetMap := make(map[string]*asset.Asset)
// ensure we don't return the same asset twice
for i := range resolved {
assetMap[resolved[i].PlatformIds[0]] = resolved[i]
}
new := make([]*asset.Asset, 0, len(assetMap))
for _, v := range assetMap {
new = append(new, v)
}

return new, nil
}

func AssembleEc2InstancesFilters(opts map[string]string) Ec2InstancesFilters {
Expand Down

0 comments on commit 43fe271

Please sign in to comment.