Open KashifSaadat opened 7 years ago
I am aware of this. This code bit could definitely be optimized. They are not entirely duplicate calls, they happen at different times for different components, but sure, some runtime state could help to minimize cloud API calls.
The addition of logging has highlighted duplication of certain API calls. On creating a full cluster (master & compute nodes), the describe-subnets ec2 API is called a minimum of 4 times (can increase depending on the amount of compute pools defined). Additionally, on building computepool0 the call to the API passes 5 subnets when only 3 were initially defined (2 ids were duplicated).
Example Logs:
The providers could potentially have a method of maintaining a local cache for certain API calls, so if the same subnet IDs are passed the details can be returned immediately.
Is there any case where the data may change mid build, requiring a re-fetch?