AWS: Make load balancer creation idempotent on AWS

This turned out to be a little convoluted, but is needed because deleting an ELB on AWS
is a painful UX - it won't have the same endpoint when it is recreated.

Also started splitting the provider into files, but only for new functions (so far!)
This commit is contained in:
Justin Santa Barbara
2015-06-13 14:45:38 -04:00
parent 8c365d51c7
commit 924350d5f6
5 changed files with 378 additions and 128 deletions

View File

@@ -131,6 +131,21 @@ func (s1 StringSet) IsSuperset(s2 StringSet) bool {
return true
}
// Equal returns true iff s1 is equal (as a set) to s2.
// Two sets are equal if their membership is identical.
// (In practice, this means same elements, order doesn't matter)
func (s1 StringSet) Equal(s2 StringSet) bool {
if len(s1) != len(s2) {
return false
}
for item := range s2 {
if !s1.Has(item) {
return false
}
}
return true
}
// List returns the contents as a sorted string slice.
func (s StringSet) List() []string {
res := make([]string, 0, len(s))