Skip to content

Commit cd85985

Browse files
committed
Merge branch 'feature/repair-gitlab'
2 parents 2ae1e6f + 2ff0fe5 commit cd85985

6 files changed

Lines changed: 17 additions & 19 deletions

File tree

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
image: golang:latest
1+
image: golang:1.12
22

33
before_script:
4+
- go version
45
- make setup
56
- make modules
67
- make generate
7-
- go version
88

99
stages:
1010
- test

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ setup:
88

99
.PHONY: modules
1010
modules:
11-
go mod tidy
11+
go mod download
1212

1313
.PHONY: generate
1414
generate:
@@ -19,7 +19,7 @@ generate:
1919
build:
2020
go build
2121

22-
.PHONY: generate
22+
.PHONY: test
2323
test: generate
2424
go clean -testcache ${PKG_LIST}
2525
go test --race -cover ${PKG_LIST}

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ require (
4646
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect
4747
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd // indirect
4848
golang.org/x/text v0.3.2 // indirect
49-
golang.org/x/tools v0.0.0-20190906181117-04840ef8f354 // indirect
5049
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
5150
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
5251
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
5352
gopkg.in/yaml.v2 v2.2.1
5453
)
5554

5655
replace git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999
56+
57+
go 1.13

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73r
219219
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
220220
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
221221
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
222-
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
223222
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM=
224223
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
225224
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -252,9 +251,6 @@ golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGm
252251
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
253252
golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
254253
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
255-
golang.org/x/tools v0.0.0-20190906181117-04840ef8f354 h1:UrBkUDEHREtPIsvVNBiEok8dCKjYiQAQYMKYxuvCElY=
256-
golang.org/x/tools v0.0.0-20190906181117-04840ef8f354/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
257-
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
258254
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
259255
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
260256
google.golang.org/api v0.1.0 h1:K6z2u68e86TPdSdefXdzvXgR1zEMa+459vBSfWYAZkI=

resource/filter.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ type Config map[TerraformResourceType][]TypeFilter
2626

2727
// TypeFilter represents an entry in Config and selects the resources of a particular resource type.
2828
type TypeFilter struct {
29-
ID *StringFilter `yaml:",omitempty"`
30-
Tags map[string]*StringFilter `yaml:",omitempty"`
29+
ID *StringFilter `yaml:",omitempty"`
30+
Tags map[string]*StringFilter `yaml:",omitempty"`
3131
// select resources by creation time
3232
Created *Created `yaml:",omitempty"`
3333
}
@@ -38,10 +38,10 @@ type StringMatcher interface {
3838

3939
type StringFilter struct {
4040
Pattern string `yaml:",omitempty"`
41-
Negate bool
41+
Negate bool
4242
}
4343

44-
type CreatedTime struct{
44+
type CreatedTime struct {
4545
time.Time `yaml:",omitempty"`
4646
}
4747

@@ -187,11 +187,11 @@ func (f Filter) matches(r *Resource) bool {
187187
func (f *StringFilter) matches(s string) (bool, error) {
188188
ok, err := regexp.MatchString(f.Pattern, s)
189189
if err != nil {
190-
return false, err
190+
return false, err
191191
}
192-
192+
193193
if f.Negate {
194-
return !ok, nil
194+
return !ok, nil
195195
}
196196

197197
return ok, err
@@ -223,11 +223,11 @@ func (c *CreatedTime) UnmarshalYAML(unmarshal func(interface{}) error) error {
223223
case string:
224224
d, err := time.ParseDuration(value)
225225
if err == nil {
226-
*c = CreatedTime{time.Now().UTC().Add(- d)}
226+
*c = CreatedTime{time.Now().UTC().Add(-d)}
227227
return nil
228228
}
229229
var t time.Time
230-
err = yaml.Unmarshal([]byte("!!timestamp " + value), &t)
230+
err = yaml.Unmarshal([]byte("!!timestamp "+value), &t)
231231
if err == nil {
232232
*c = CreatedTime{t}
233233
return nil
@@ -262,4 +262,4 @@ func (c *CreatedTime) UnmarshalYAML(unmarshal func(interface{}) error) error {
262262
}
263263
}
264264
return errors.New("invalid created time")
265-
}
265+
}

test/instance_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ resource "aws_vpc" "foo" {
188188
resource "aws_subnet" "foo" {
189189
vpc_id = "${aws_vpc.foo.id}"
190190
cidr_block = "10.1.0.1/24"
191+
availability_zone = "us-west-2a"
191192
192193
tags {
193194
Name = "awsweeper-testacc"

0 commit comments

Comments
 (0)