mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(elb): return TargetGroupNotFound for missing target groups (#1161)
This commit is contained in:
1 parent
30a598f080
commit
289e1e9630
2 files changed
+33
-1
No files matched your search
@@ -238,13 +238,16 @@ public class ElbV2Service {
|
||||
if (tgArns != null && !tgArns.isEmpty()) {
|
||||
Set<String> arnSet = new HashSet<>(tgArns);
|
||||
result = result.stream().filter(tg -> arnSet.contains(tg.getTargetGroupArn())).collect(Collectors.toList());
|
||||
if (result.isEmpty()) {
|
||||
if (result.size() != arnSet.size()) {
|
||||
throw new AwsException("TargetGroupNotFound", "One or more target groups not found.", 400);
|
||||
}
|
||||
}
|
||||
if (names != null && !names.isEmpty()) {
|
||||
Set<String> nameSet = new HashSet<>(names);
|
||||
result = result.stream().filter(tg -> nameSet.contains(tg.getTargetGroupName())).collect(Collectors.toList());
|
||||
if (result.size() != nameSet.size()) {
|
||||
throw new AwsException("TargetGroupNotFound", "One or more target groups not found.", 400);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user