-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add instance update and reactivation
Adds functionality to perform Bottlerocket version upgrades and reactivates drained instances after successful upgrade. [Issue: #9]
- Loading branch information
Will Moore
committed
Apr 13, 2021
1 parent
430af79
commit 7880e70
Showing
3 changed files
with
89 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package main | ||
|
||
|
||
func sanitizeIDs(instanceIDs []*string) []*string { | ||
// If the instanceID occurs the flag changes to true. | ||
// All instanceIDs that has already occurred will be true. | ||
flag := make(map[*string]bool) | ||
var uniqueIDs []*string | ||
for _, ID := range instanceIDs { | ||
if flag[ID] == false { | ||
flag[ID] = true | ||
uniqueIDs = append(uniqueIDs, ID) | ||
} | ||
} | ||
// unique names collected | ||
return uniqueIDs | ||
} |