44 "flag"
55 "os"
66 "sort"
7+ "strings"
78
89 "github.com/hortonworks/cloud-haunter/utils"
910
@@ -38,9 +39,13 @@ func main() {
3839 verbose := flag .Bool ("v" , false , "verbose" )
3940 ignoreLabelDisabled := flag .Bool ("i" , false , "disable ignore label" )
4041 exactMatchOwner := flag .Bool ("e" , false , "exact match owner" )
42+ workaroundAWsIgnoreStack := flag .Bool ("awsignore" , false , "AWS stack ignore workaround" )
43+ excludedAwsRegions := flag .String ("excludeAwsRegion" , "" , "comma separated list of AWS regions to exclude" )
4144
4245 flag .Parse ()
4346
47+ parseRegionsStr (* excludedAwsRegions )
48+
4449 if * help {
4550 printHelp ()
4651 os .Exit (0 )
@@ -53,6 +58,7 @@ func main() {
5358 }
5459 ctx .IgnoreLabelDisabled = * ignoreLabelDisabled
5560 ctx .ExactMatchOwner = * exactMatchOwner
61+ ctx .WorkaroundAwsIgnoreStack = * workaroundAWsIgnoreStack
5662
5763 if filterConfigLoc != nil && len (* filterConfigLoc ) != 0 {
5864 var err error
@@ -119,6 +125,7 @@ func main() {
119125 items = filter .Execute (items )
120126 }
121127 action .Execute (* op , filterNames , items )
128+ println ("All operations completed." )
122129}
123130
124131// should be kept in sync with README.md
@@ -182,3 +189,10 @@ func getSortedActions() []string {
182189 sort .Strings (actions )
183190 return actions
184191}
192+
193+ func parseRegionsStr (regionsStr string ) {
194+ regionList := strings .Split (regionsStr , "," )
195+ for _ , item := range regionList {
196+ ctx .AwsExcludedRegions [strings .ToLower (item )] = true
197+ }
198+ }
0 commit comments