Skip to content

Commit 139e5e2

Browse files
authored
remove az for pending major release (#42)
* remove az for pending major release * set go version for e2e test * remove it from more places and fix tests
1 parent acdbb43 commit 139e5e2

File tree

6 files changed

+6
-32
lines changed

6 files changed

+6
-32
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
name: License Test
4545
- stage: Test
4646
if: type = push AND env(GITHUB_TOKEN) IS present
47+
go: "1.14.x"
4748
script: make e2e-test
4849
name: E2E Tests
4950
- stage: Deploy

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ ec2-instance-selector --memory-min 4 --memory-max 8 --vcpus-min 4 --vcpus-max 8
136136
137137
Filter Flags:
138138
--allow-list string List of allowed instance types to select from w/ regex syntax (Example: m[3-5]\.*)
139-
--availability-zone string [DEPRECATED] use --availability-zones instead
140139
-z, --availability-zones strings Availability zones or zone ids to check EC2 capacity offered in specific AZs
141140
--baremetal Bare Metal instance types (.metal instances)
142141
-b, --burst-support Burstable instance types

cmd/main.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ const (
6161
fpgaSupport = "fpga-support"
6262
burstSupport = "burst-support"
6363
hypervisor = "hypervisor"
64-
availabilityZone = "availability-zone"
6564
availabilityZones = "availability-zones"
6665
currentGeneration = "current-generation"
6766
networkInterfaces = "network-interfaces"
@@ -130,7 +129,6 @@ Full docs can be found at github.com/aws/amazon-` + binName
130129
cli.BoolFlag(fpgaSupport, cli.StringMe("f"), nil, "FPGA instance types")
131130
cli.BoolFlag(burstSupport, cli.StringMe("b"), nil, "Burstable instance types")
132131
cli.StringFlag(hypervisor, nil, nil, "Hypervisor: [xen or nitro]", nil)
133-
cli.StringFlag(availabilityZone, nil, nil, "[DEPRECATED] use --availability-zones instead", nil)
134132
cli.StringSliceFlag(availabilityZones, cli.StringMe("z"), nil, "Availability zones or zone ids to check EC2 capacity offered in specific AZs")
135133
cli.BoolFlag(currentGeneration, nil, nil, "Current generation instance types (explicitly set this to false to not return current generation instance types)")
136134
cli.IntMinMaxRangeFlags(networkInterfaces, nil, nil, "Number of network interfaces (ENIs) that can be attached to the instance")
@@ -176,15 +174,6 @@ Full docs can be found at github.com/aws/amazon-` + binName
176174
}
177175
flags[region] = sess.Config.Region
178176

179-
if flags[availabilityZone] != nil {
180-
log.Printf("You are using a deprecated flag --%s which will be removed in future versions, switch to --%s to avoid issues.\n", availabilityZone, availabilityZones)
181-
if flags[availabilityZones] != nil {
182-
flags[availabilityZones] = append(*cli.StringSliceMe(flags[availabilityZones]), *cli.StringMe(flags[availabilityZone]))
183-
} else {
184-
flags[availabilityZones] = []string{*cli.StringMe(flags[availabilityZone])}
185-
}
186-
}
187-
188177
instanceSelector := selector.New(sess)
189178

190179
filters := selector.Filters{

pkg/selector/selector.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,6 @@ func (itf Selector) rawFilter(filters Filters) ([]*ec2.InstanceTypeInfo, error)
143143
}
144144
var locations []string
145145

146-
// Support the deprecated singular availabilityZone filter in favor of the plural
147-
if filters.AvailabilityZone != nil {
148-
if filters.AvailabilityZones != nil {
149-
*filters.AvailabilityZones = append(*filters.AvailabilityZones, *filters.AvailabilityZone)
150-
} else {
151-
filters.AvailabilityZones = &[]string{*filters.AvailabilityZone}
152-
}
153-
}
154-
155146
if filters.CPUArchitecture != nil && *filters.CPUArchitecture == cpuArchitectureAMD64 {
156147
*filters.CPUArchitecture = cpuArchitectureX8664
157148
}

pkg/selector/selector_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ func TestFilterVerbose_AZFilteredIn(t *testing.T) {
197197
EC2: ec2Mock,
198198
}
199199
filters := selector.Filters{
200-
VCpusRange: &selector.IntRangeFilter{LowerBound: 2, UpperBound: 2},
201-
AvailabilityZone: aws.String("us-east-2a"),
200+
VCpusRange: &selector.IntRangeFilter{LowerBound: 2, UpperBound: 2},
201+
AvailabilityZones: &[]string{"us-east-2a"},
202202
}
203203
results, err := itf.FilterVerbose(filters)
204204
h.Ok(t, err)
@@ -216,7 +216,7 @@ func TestFilterVerbose_AZFilteredOut(t *testing.T) {
216216
EC2: ec2Mock,
217217
}
218218
filters := selector.Filters{
219-
AvailabilityZone: aws.String("us-east-2a"),
219+
AvailabilityZones: &[]string{"us-east-2a"},
220220
}
221221
results, err := itf.FilterVerbose(filters)
222222
h.Ok(t, err)
@@ -229,8 +229,8 @@ func TestFilterVerboseAZ_FilteredErr(t *testing.T) {
229229
EC2: ec2Mock,
230230
}
231231
filters := selector.Filters{
232-
VCpusRange: &selector.IntRangeFilter{LowerBound: 2, UpperBound: 2},
233-
AvailabilityZone: aws.String("blah"),
232+
VCpusRange: &selector.IntRangeFilter{LowerBound: 2, UpperBound: 2},
233+
AvailabilityZones: &[]string{"blah"},
234234
}
235235
_, err := itf.FilterVerbose(filters)
236236
h.Assert(t, err != nil, "Should error since bad zone was passed in")

pkg/selector/types.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@ type Filters struct {
9898
// Example: us-east-1a, us-east-1b, us-east-2a, etc. OR use1-az1, use2-az2, etc.
9999
AvailabilityZones *[]string
100100

101-
// AvailabilityZone [DEPRECATED] is the AWS Availability Zone where instances will be provisioned.
102-
// Instance type capacity can vary between availability zones.
103-
// Will accept zone name or id
104-
// Example: us-east-1a, us-east-1b, us-east-2a, etc. OR use1-az1, use2-az2, etc.
105-
AvailabilityZone *string
106-
107101
// BareMetal is used to only return bare metal instance type results
108102
BareMetal *bool
109103

0 commit comments

Comments
 (0)