diff --git a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2ImageSupplier.java b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2ImageSupplier.java index 2f039873a7..b1dd1d16fe 100644 --- a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2ImageSupplier.java +++ b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2ImageSupplier.java @@ -34,6 +34,7 @@ import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; +import com.google.common.collect.ForwardingSet; import org.jclouds.Constants; import org.jclouds.aws.ec2.compute.config.ClusterCompute; import org.jclouds.compute.domain.Image; @@ -127,7 +128,11 @@ public class AWSEC2ImageSupplier implements Supplier> { logger.debug("<< images(%d)", imageMap.size()); // TODO Used to be mutable; was this assumed anywhere? - return ImmutableSet.copyOf(imageMap.values()); + return new ForwardingSet() { + protected Set delegate() { + return ImmutableSet.copyOf(cache.get().asMap().values()); + } + }; } private Future> images(Iterable regions, String query, String tag) {