Repository: zalando-incubator/kube-ingress-aws-controller
Pull request #244 (2019-04-09 14:46:21)

Go modules
This PR introduces two changes:

* Go modules
* gometalinter is deprecated, instead we could try out golangci-lint

coveralls: 
[![Coverage Status](https://coveralls.io/builds/22697831/badge)](https://coveralls.io/builds/22697831)

Coverage remained the same at 46.759% when pulling **7bb904a2b6a77b9b96311edb255240c33ca85aa0 on gomod** into **c5fd0b24ae038b0dee973cfb19ae7c86e881dad6 on master**.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/22697831/badge)](https://coveralls.io/builds/22697831)

Coverage remained the same at 46.759% when pulling **7bb904a2b6a77b9b96311edb255240c33ca85aa0 on gomod** into **c5fd0b24ae038b0dee973cfb19ae7c86e881dad6 on master**.


Patch:
diff --git a/.golangci.yml b/.golangci.yml
new file mode 100644
index 0000000..37ef4dc
--- /dev/null
+++ b/.golangci.yml
@@ -0,0 +1,15 @@
+run:
+  concurrency: 4
+
+linters-settings:
+  golint:
+      min-confidence: 0.9
+
+linters:
+  disable-all: true
+  enable:
+    - staticcheck
+    - govet
+    - ineffassign
+    - golint
+    - goimports
diff --git a/.travis.yml b/.travis.yml
index 70336c9..88926dd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,4 @@
-dist: trusty
+dist: xenial
 
 os:
 - linux
@@ -6,22 +6,21 @@ os:
 language: go
 
 go:
-- 1.x
+- "1.12.x"
 - tip
 
 matrix:
   allow_failures:
   - go: tip
 
+env:
+  GO111MODULE=on GOLANGCI_RELEASE="v1.16.0"
+
 before_install:
-- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
 - go get github.com/mattn/goveralls
-- go get github.com/alecthomas/gometalinter
-
-install:
-- dep ensure -v -vendor-only
-- gometalinter --install
+- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_RELEASE}
 
 script:
 - make test
+- make lint
 - goveralls -service=travis-ci
diff --git a/Dockerfile b/Dockerfile
index d573030..e5f31f0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,18 +1,15 @@
 # builder image
 FROM golang as builder
 
-RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
-WORKDIR /go/src/github.com/zalando-incubator/kube-ingress-aws-controller
+WORKDIR /github.com/zalando-incubator/kube-ingress-aws-controller
 COPY . .
-RUN dep ensure -v -vendor-only
-RUN make test
 RUN make build.linux
 
 # final image
 FROM registry.opensource.zalan.do/stups/alpine:latest
 MAINTAINER Team Teapot @ Zalando SE <team-teapot@zalando.de>
 
-COPY --from=builder /go/src/github.com/zalando-incubator/kube-ingress-aws-controller/build/linux/kube-ingress-aws-controller \
+COPY --from=builder /github.com/zalando-incubator/kube-ingress-aws-controller/build/linux/kube-ingress-aws-controller \
   /bin/kube-ingress-aws-controller
 
 ENTRYPOINT ["/bin/kube-ingress-aws-controller"]
diff --git a/Gopkg.lock b/Gopkg.lock
deleted file mode 100644
index 6e9cf4b..0000000
--- a/Gopkg.lock
+++ /dev/null
@@ -1,247 +0,0 @@
-# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-
-
-[[projects]]
-  digest = "1:e4226d2bbaaff0289b1de3472bfd902d0c61029768db7c223b0cfc97983d4757"
-  name = "github.com/aws/aws-sdk-go"
-  packages = [
-    "aws",
-    "aws/awserr",
-    "aws/awsutil",
-    "aws/client",
-    "aws/client/metadata",
-    "aws/corehandlers",
-    "aws/credentials",
-    "aws/credentials/ec2rolecreds",
-    "aws/credentials/endpointcreds",
-    "aws/credentials/stscreds",
-    "aws/defaults",
-    "aws/ec2metadata",
-    "aws/endpoints",
-    "aws/request",
-    "aws/session",
-    "aws/signer/v4",
-    "internal/sdkio",
-    "internal/sdkrand",
-    "internal/shareddefaults",
-    "private/protocol",
-    "private/protocol/ec2query",
-    "private/protocol/json/jsonutil",
-    "private/protocol/jsonrpc",
-    "private/protocol/query",
-    "private/protocol/query/queryutil",
-    "private/protocol/rest",
-    "private/protocol/xml/xmlutil",
-    "service/acm",
-    "service/acm/acmiface",
-    "service/autoscaling",
-    "service/autoscaling/autoscalingiface",
-    "service/cloudformation",
-    "service/cloudformation/cloudformationiface",
-    "service/ec2",
-    "service/ec2/ec2iface",
-    "service/elbv2",
-    "service/elbv2/elbv2iface",
-    "service/iam",
-    "service/iam/iamiface",
-    "service/sts",
-  ]
-  pruneopts = "UT"
-  revision = "5197757a58a794d49d2d0c50a932997157734100"
-  version = "v1.13.60"
-
-[[projects]]
-  branch = "master"
-  digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d"
-  name = "github.com/beorn7/perks"
-  packages = ["quantile"]
-  pruneopts = "UT"
-  revision = "3a771d992973f24aa725d07868b467d1ddfceafb"
-
-[[projects]]
-  digest = "1:a2c1d0e43bd3baaa071d1b9ed72c27d78169b2b269f71c105ac4ba34b1be4a39"
-  name = "github.com/davecgh/go-spew"
-  packages = ["spew"]
-  pruneopts = "UT"
-  revision = "346938d642f2ec3594ed81d874461961cd0faa76"
-  version = "v1.1.0"
-
-[[projects]]
-  digest = "1:50772cf1f376b08cb57b4e8e9225775d9f9f4aad8487313afcb66846ceaa5d4c"
-  name = "github.com/go-ini/ini"
-  packages = ["."]
-  pruneopts = "UT"
-  revision = "32e4c1e6bc4e7d0d8451aa6b75200d19e37a536a"
-  version = "v1.32.0"
-
-[[projects]]
-  digest = "1:e1ff887e232b2d8f4f7c7db15a5fac7be418025afc4dda53c59c765dbb5aa6b4"
-  name = "github.com/go-playground/locales"
-  packages = [
-    ".",
-    "currency",
-  ]
-  pruneopts = "UT"
-  revision = "f63010822830b6fe52288ee52d5a1151088ce039"
-  version = "v0.12.1"
-
-[[projects]]
-  branch = "master"
-  digest = "1:eb758dc813fc3fdf7194c82883b734a8419b1cd6eee3e184d3f6777e248ef9ce"
-  name = "github.com/go-playground/universal-translator"
-  packages = ["."]
-  pruneopts = "UT"
-  revision = "71201497bace774495daed26a3874fd339e0b538"
-
-[[projects]]
-  digest = "1:9b0e71863f18fc5de645a263184c8a6409ae731e847b35b25da4be818f1975fa"
-  name = "github.com/golang/protobuf"
-  packages = ["proto"]
-  pruneopts = "UT"
-  revision = "1e59b77b52bf8e4b449a57e6f79f21226d571845"
-
-[[projects]]
-  digest = "1:8f8811f9be822914c3a25c6a071e93beb4c805d7b026cbf298bc577bc1cc945b"
-  name = "github.com/google/uuid"
-  packages = ["."]
-  pruneopts = "UT"
-  revision = "064e2069ce9c359c118179501254f67d7d37ba24"
-  version = "0.2"
-
-[[projects]]
-  digest = "1:e22af8c7518e1eab6f2eab2b7d7558927f816262586cd6ed9f349c97a6c285c4"
-  name = "github.com/jmespath/go-jmespath"
-  packages = ["."]
-  pruneopts = "UT"
-  revision = "0b12d6b5"
-
-[[projects]]
-  digest = "1:dbf815f0a486a0a5eb5ad67dae599f856f679520d8a2d007dbd7045077deac69"
-  name = "github.com/linki/instrumented_http"
-  packages = ["."]
-  pruneopts = "UT"
-  revision = "508103cfb3b315fa9752b5bcd4fb2d97bbc26d89"
-  version = "v0.2.0"
-
-[[projects]]
-  digest = "1:ff5ebae34cfbf047d505ee150de27e60570e8c394b3b8fdbb720ff6ac71985fc"
-  name = "github.com/matttproud/golang_protobuf_extensions"
-  packages = ["pbutil"]
-  pruneopts = "UT"
-  revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c"
-  version = "v1.0.1"
-
-[[projects]]
-  branch = "master"
-  digest = "1:98e9c246610f7ba6918f4900763fb5ed4a2a326db290a6a0515db90cf9e2b361"
-  name = "github.com/mweagle/go-cloudformation"
-  packages = ["."]
-  pruneopts = "UT"
-  revision = "e40a034597a3952017f3bb0c75caa8491616dff1"
-
-[[projects]]
-  digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747"
-  name = "github.com/pkg/errors"
-  packages = ["."]
-  pruneopts = "UT"
-  revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
-  version = "v0.8.0"
-
-[[projects]]
-  digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe"
-  name = "github.com/pmezard/go-difflib"
-  packages = ["difflib"]
-  pruneopts = "UT"
-  revision = "792786c7400a136282c1664665ae0a8db921c6c2"
-  version = "v1.0.0"
-
-[[projects]]
-  digest = "1:d14a5f4bfecf017cb780bdde1b6483e5deb87e12c332544d2c430eda58734bcb"
-  name = "github.com/prometheus/client_golang"
-  packages = [
-    "prometheus",
-    "prometheus/promhttp",
-  ]
-  pruneopts = "UT"
-  revision = "c5b7fccd204277076155f10851dad72b76a49317"
-  version = "v0.8.0"
-
-[[projects]]
-  digest = "1:32d10bdfa8f09ecf13598324dba86ab891f11db3c538b6a34d1c3b5b99d7c36b"
-  name = "github.com/prometheus/client_model"
-  packages = ["go"]
-  pruneopts = "UT"
-  revision = "6f3806018612930941127f2a7c6c453ba2c527d2"
-
-[[projects]]
-  digest = "1:79ac6d18d6b7eabed09995d83689c2c1d3c09dfdd892ddf3d2202765bef23582"
-  name = "github.com/prometheus/common"
-  packages = [
-    "expfmt",
-    "internal/bitbucket.org/ww/goautoneg",
-    "model",
-  ]
-  pruneopts = "UT"
-  revision = "e3fb1a1acd7605367a2b378bc2e2f893c05174b7"
-
-[[projects]]
-  digest = "1:93ed91deb3bb95cf63bbe5ae3f16eb4b7559b438fc3a3c6917cd12cc31e38c08"
-  name = "github.com/prometheus/procfs"
-  packages = [
-    ".",
-    "xfs",
-  ]
-  pruneopts = "UT"
-  revision = "a6e9df898b1336106c743392c48ee0b71f5c4efa"
-
-[[projects]]
-  digest = "1:c40d65817cdd41fac9aa7af8bed56927bb2d6d47e4fea566a74880f5c2b1c41e"
-  name = "github.com/stretchr/testify"
-  packages = [
-    "assert",
-    "require",
-  ]
-  pruneopts = "UT"
-  revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686"
-  version = "v1.2.2"
-
-[[projects]]
-  digest = "1:c16592d21abe12650b3b83c3cd32b6a28cef156aab1ab153de70f6795f8c8e6d"
-  name = "gopkg.in/go-playground/validator.v9"
-  packages = ["."]
-  pruneopts = "UT"
-  revision = "ce9336f6e200cbb2e7c5672b36095b03f8bf5af7"
-  version = "v9.19.0"
-
-[solve-meta]
-  analyzer-name = "dep"
-  analyzer-version = 1
-  input-imports = [
-    "github.com/aws/aws-sdk-go/aws",
-    "github.com/aws/aws-sdk-go/aws/awserr",
-    "github.com/aws/aws-sdk-go/aws/client",
-    "github.com/aws/aws-sdk-go/aws/ec2metadata",
-    "github.com/aws/aws-sdk-go/aws/request",
-    "github.com/aws/aws-sdk-go/aws/session",
-    "github.com/aws/aws-sdk-go/service/acm",
-    "github.com/aws/aws-sdk-go/service/acm/acmiface",
-    "github.com/aws/aws-sdk-go/service/autoscaling",
-    "github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface",
-    "github.com/aws/aws-sdk-go/service/cloudformation",
-    "github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface",
-    "github.com/aws/aws-sdk-go/service/ec2",
-    "github.com/aws/aws-sdk-go/service/ec2/ec2iface",
-    "github.com/aws/aws-sdk-go/service/elbv2",
-    "github.com/aws/aws-sdk-go/service/elbv2/elbv2iface",
-    "github.com/aws/aws-sdk-go/service/iam",
-    "github.com/aws/aws-sdk-go/service/iam/iamiface",
-    "github.com/google/uuid",
-    "github.com/linki/instrumented_http",
-    "github.com/mweagle/go-cloudformation",
-    "github.com/pkg/errors",
-    "github.com/prometheus/client_golang/prometheus/promhttp",
-    "github.com/stretchr/testify/assert",
-    "github.com/stretchr/testify/require",
-  ]
-  solver-name = "gps-cdcl"
-  solver-version = 1
diff --git a/Gopkg.toml b/Gopkg.toml
deleted file mode 100644
index 18ebe95..0000000
--- a/Gopkg.toml
+++ /dev/null
@@ -1,58 +0,0 @@
-# Gopkg.toml example
-#
-# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
-# for detailed Gopkg.toml documentation.
-#
-# required = ["github.com/user/thing/cmd/thing"]
-# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
-#
-# [[constraint]]
-#   name = "github.com/user/project"
-#   version = "1.0.0"
-#
-# [[constraint]]
-#   name = "github.com/user/project2"
-#   branch = "dev"
-#   source = "github.com/myfork/project2"
-#
-# [[override]]
-#   name = "github.com/x/y"
-#   version = "2.4.0"
-#
-# [prune]
-#   non-go = false
-#   go-tests = true
-#   unused-packages = true
-
-
-[[constraint]]
-  name = "github.com/aws/aws-sdk-go"
-  version = "^1.13.6"
-
-[[constraint]]
-  name = "github.com/google/uuid"
-  version = "0.2.0"
-
-[[constraint]]
-  name = "github.com/linki/instrumented_http"
-  version = "0.2.0"
-
-[[constraint]]
-  branch = "master"
-  name = "github.com/mweagle/go-cloudformation"
-
-[[constraint]]
-  name = "github.com/pkg/errors"
-  version = "0.8.0"
-
-[[constraint]]
-  name = "github.com/prometheus/client_golang"
-  version = "0.8.0"
-
-[[constraint]]
-  name = "github.com/stretchr/testify"
-  version = "^1.2.2"
-
-[prune]
-  go-tests = true
-  unused-packages = true
diff --git a/Makefile b/Makefile
index 8f7668b..ffae9ad 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,9 @@ clean:
 test:
 	go test -v -race -cover $(GOPKGS)
 
+lint:
+	golangci-lint run ./...
+
 fmt:
 	go fmt $(GOPKGS)
 
@@ -40,7 +43,7 @@ build/osx/$(BINARY): $(SOURCES)
 	GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/osx/$(BINARY) -ldflags "$(LDFLAGS)" .
 
 build.docker:
-	docker build -t "$(IMAGE):$(TAG)" -f $(DOCKERFILE) .
+	docker build --rm -t "$(IMAGE):$(TAG)" -f $(DOCKERFILE) .
 
 build.push: build.docker
 	docker push "$(IMAGE):$(TAG)"
diff --git a/aws/adapter.go b/aws/adapter.go
index ec1cac5..c9289e2 100644
--- a/aws/adapter.go
+++ b/aws/adapter.go
@@ -91,9 +91,9 @@ const (
 	DefaultSslPolicy = "ELBSecurityPolicy-2016-08"
 	// DefaultIpAddressType sets IpAddressType to "ipv4", it is either ipv4 or dualstack
 	DefaultIpAddressType = "ipv4"
-	// Default ALB logging S3 bucket is a blank string, and must be set if enabled
+	// DefaultAlbS3LogsBucket is a blank string, and must be set if enabled
 	DefaultAlbS3LogsBucket = ""
-	// Default ALB logging S3 prefix is a blank string, and optionally set if desired
+	// DefaultAlbS3LogsPrefix is a blank string, and optionally set if desired
 	DefaultAlbS3LogsPrefix = ""
 	DefaultWafWebAclId     = ""
 
diff --git a/aws/asg.go b/aws/asg.go
index 37b1078..d85b91a 100644
--- a/aws/asg.go
+++ b/aws/asg.go
@@ -39,10 +39,10 @@ func getAutoScalingGroupByName(service autoscalingiface.AutoScalingAPI, autoScal
 				tags[aws.StringValue(td.Key)] = aws.StringValue(td.Value)
 			}
 			return &autoScalingGroupDetails{
-				name: autoScalingGroupName,
-				arn:  aws.StringValue(g.AutoScalingGroupARN),
-				launchConfigurationName: aws.StringValue(g.LaunchConfigurationName),
+				name:                    autoScalingGroupName,
+				arn:                     aws.StringValue(g.AutoScalingGroupARN),
 				targetGroups:            aws.StringValueSlice(g.TargetGroupARNs),
+				launchConfigurationName: aws.StringValue(g.LaunchConfigurationName),
 				tags:                    tags,
 			}, nil
 		}
@@ -68,8 +68,8 @@ func getAutoScalingGroupsByName(service autoscalingiface.AutoScalingAPI, autoSca
 			tags[aws.StringValue(td.Key)] = aws.StringValue(td.Value)
 		}
 		result[name] = &autoScalingGroupDetails{
-			name: name,
-			arn:  aws.StringValue(g.AutoScalingGroupARN),
+			name:                    name,
+			arn:                     aws.StringValue(g.AutoScalingGroupARN),
 			launchConfigurationName: aws.StringValue(g.LaunchConfigurationName),
 			targetGroups:            aws.StringValueSlice(g.TargetGroupARNs),
 			tags:                    tags,
diff --git a/aws/cf_template.go b/aws/cf_template.go
index f5a5c77..9844d59 100644
--- a/aws/cf_template.go
+++ b/aws/cf_template.go
@@ -8,7 +8,7 @@ import (
 	"crypto/sha256"
 	"sort"
 
-	"github.com/mweagle/go-cloudformation"
+	cloudformation "github.com/mweagle/go-cloudformation"
 )
 
 func hashARNs(certARNs []string) []byte {
diff --git a/aws/ec2.go b/aws/ec2.go
index ce538a4..b0bd95d 100644
--- a/aws/ec2.go
+++ b/aws/ec2.go
@@ -173,7 +173,7 @@ func getSubnets(svc ec2iface.EC2API, vpcID, clusterID string) ([]*subnetDetails,
 		return nil, err
 	}
 
-	retAll      := make([]*subnetDetails, len(resp.Subnets))
+	retAll := make([]*subnetDetails, len(resp.Subnets))
 	retFiltered := make([]*subnetDetails, 0)
 	for i, sn := range resp.Subnets {
 		az := aws.StringValue(sn.AvailabilityZone)
@@ -189,7 +189,7 @@ func getSubnets(svc ec2iface.EC2API, vpcID, clusterID string) ([]*subnetDetails,
 			public:           isPublic,
 			tags:             tags,
 		}
-		if _, ok := tags[clusterIDTagPrefix + clusterID]; ok {
+		if _, ok := tags[clusterIDTagPrefix+clusterID]; ok {
 			retFiltered = append(retFiltered, &subnetDetails{
 				id:               subnetID,
 				availabilityZone: az,
diff --git a/delivery.yaml b/delivery.yaml
index 7957838..fe89806 100644
--- a/delivery.yaml
+++ b/delivery.yaml
@@ -1,15 +1,26 @@
 version: "2017-09-20"
 pipeline:
 - id: build
+  overlay: ci/golang
+  cache:
+    paths:
+    - /go/pkg/mod       # pkg cache for Go modules
+    - ~/.cache/go-build # Go build cache
   type: script
   commands:
-  - desc: Build and push docker image
+  - desc: test
+    cmd: |
+      make test
+  - desc: Build docker image
+    cmd: |
+      make build.docker
+  - desc: Push docker image
     cmd: |
       if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
-        RELEASE_VERSION=$(git describe --tags --always --dirty)
-        IMAGE=registry-write.opensource.zalan.do/teapot/kube-ingress-aws-controller:${RELEASE_VERSION}
+        IMAGE=registry-write.opensource.zalan.do/teapot/kube-ingress-aws-controller
+        VERSION=$(git describe --tags --always --dirty)
       else
-        IMAGE=registry-write.opensource.zalan.do/teapot/kube-ingress-aws-controller-test:${CDP_BUILD_VERSION}
+        IMAGE=registry-write.opensource.zalan.do/teapot/kube-ingress-aws-controller-test
+        VERSION=$CDP_BUILD_VERSION
       fi
-      docker build --tag "$IMAGE" .
-      docker push "$IMAGE"
+      IMAGE=$IMAGE VERSION=$VERSION make build.push
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..20aa549
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,26 @@
+module github.com/zalando-incubator/kube-ingress-aws-controller
+
+go 1.12
+
+require (
+	github.com/aws/aws-sdk-go v1.13.60
+	github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973
+	github.com/davecgh/go-spew v1.1.0
+	github.com/go-ini/ini v1.32.0
+	github.com/go-playground/locales v0.12.1
+	github.com/go-playground/universal-translator v0.0.0-20170327191703-71201497bace
+	github.com/golang/protobuf v0.0.0-20171113180720-1e59b77b52bf
+	github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c
+	github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8
+	github.com/linki/instrumented_http v0.2.0
+	github.com/matttproud/golang_protobuf_extensions v1.0.1
+	github.com/mweagle/go-cloudformation v0.0.0-20180525044411-e40a034597a3
+	github.com/pkg/errors v0.8.0
+	github.com/pmezard/go-difflib v1.0.0
+	github.com/prometheus/client_golang v0.8.0
+	github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612
+	github.com/prometheus/common v0.0.0-20171104095907-e3fb1a1acd76
+	github.com/prometheus/procfs v0.0.0-20171017214025-a6e9df898b13
+	github.com/stretchr/testify v1.2.2
+	gopkg.in/go-playground/validator.v9 v9.19.0
+)
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..6162815
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,40 @@
+github.com/aws/aws-sdk-go v1.13.60 h1:0p10uYWjtcRhkqsZkcNw9mmB7ee1w+4/mq8Z6BPbrH0=
+github.com/aws/aws-sdk-go v1.13.60/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/go-ini/ini v1.32.0 h1:/MArBHSS0TFR28yPPDK1vPIjt4wUnPBfb81i6iiyKvA=
+github.com/go-ini/ini v1.32.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
+github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc=
+github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
+github.com/go-playground/universal-translator v0.0.0-20170327191703-71201497bace h1:vfBaUX49VsqTxXGADDIWvTPvaU4AbQyX/yENHE0f7AY=
+github.com/go-playground/universal-translator v0.0.0-20170327191703-71201497bace/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
+github.com/golang/protobuf v0.0.0-20171113180720-1e59b77b52bf h1:pFr/u+m8QUBMW/itAczltF3guNRAL7XDs5tD3f6nSD0=
+github.com/golang/protobuf v0.0.0-20171113180720-1e59b77b52bf/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c h1:jWtZjFEUE/Bz0IeIhqCnyZ3HG6KRXSntXe4SjtuTH7c=
+github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE=
+github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
+github.com/linki/instrumented_http v0.2.0 h1:zLhcB3Q/McQQqml3qd5kzdZ0cGnL3vquPFIW2338f5Y=
+github.com/linki/instrumented_http v0.2.0/go.mod h1:pjYbItoegfuVi2GUOMhEqzvm/SJKuEL3H0tc8QRLRFk=
+github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
+github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/mweagle/go-cloudformation v0.0.0-20180525044411-e40a034597a3 h1:+EUzCls6hotoQKC1J6ofmC1WQWRjzLNHG5UaJ5v0fbA=
+github.com/mweagle/go-cloudformation v0.0.0-20180525044411-e40a034597a3/go.mod h1:ZkuUgvDIuRW0sYTRfCz7VmL3IodhIufcb8HNdI6b6AI=
+github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_golang v0.8.0 h1:1921Yw9Gc3iSc4VQh3PIoOqgPCZS7G/4xQNVUp8Mda8=
+github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
+github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612 h1:13pIdM2tpaDi4OVe24fgoIS7ZTqMt0QI+bwQsX5hq+g=
+github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/common v0.0.0-20171104095907-e3fb1a1acd76 h1:g2v6dZgmqj2wYGPgHYX5WVaQ9IwV1ylsSiD+f8RvS1Y=
+github.com/prometheus/common v0.0.0-20171104095907-e3fb1a1acd76/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
+github.com/prometheus/procfs v0.0.0-20171017214025-a6e9df898b13 h1:leRfx9kcgnSDkqAFhaaUcRqpAZgnFdwZkZcdRcea1h0=
+github.com/prometheus/procfs v0.0.0-20171017214025-a6e9df898b13/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+gopkg.in/go-playground/validator.v9 v9.19.0 h1:PTE3gBwP61sZfxOsROkUZbXONv+7N5Mw1Et6S+4NGBA=
+gopkg.in/go-playground/validator.v9 v9.19.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
diff --git a/worker.go b/worker.go
index 67fbd25..75d5550 100644
--- a/worker.go
+++ b/worker.go
@@ -355,7 +355,7 @@ func buildManagedModel(certs CertificatesFinder, certsPerALB int, certTTL time.D
 
 func createStack(awsAdapter *aws.Adapter, lb *loadBalancer) {
 	certificates := make([]string, 0, len(lb.ingresses))
-	for cert, _ := range lb.ingresses {
+	for cert := range lb.ingresses {
 		certificates = append(certificates, cert)
 	}
 


Test patch:
diff --git a/aws/adapter_test.go b/aws/adapter_test.go
index 4ff9071..c42f906 100644
--- a/aws/adapter_test.go
+++ b/aws/adapter_test.go
@@ -406,7 +406,7 @@ func TestUpdateAutoScalingGroupsAndInstances(tt *testing.T) {
 		{
 			"error-fetching-instance",
 			ec2MockOutputs{describeInstancesPages: mockDIPOutput(
-				dummyErr,
+				errDummy,
 				testInstance{},
 			)},
 			autoscalingMockOutputs{},
@@ -430,7 +430,7 @@ func TestUpdateAutoScalingGroupsAndInstances(tt *testing.T) {
 				testInstance{id: "fail", tags: tags{"aws:autoscaling:groupName": "none"}, privateIp: "0.2.2.2", vpcId: "1", state: runningState},
 			)},
 			autoscalingMockOutputs{
-				describeAutoScalingGroups: R(mockDASGOutput(map[string]asgtags{}), dummyErr),
+				describeAutoScalingGroups: R(mockDASGOutput(map[string]asgtags{}), errDummy),
 			},
 			7,
 			[]string{"asg1", "asg2"},
diff --git a/aws/asg_test.go b/aws/asg_test.go
index 25c0c2b..7268948 100644
--- a/aws/asg_test.go
+++ b/aws/asg_test.go
@@ -73,7 +73,7 @@ func TestGetAutoScalingGroupByName(t *testing.T) {
 		{
 			"autoscaling-api-failure",
 			"dontcare",
-			autoscalingMockOutputs{describeAutoScalingGroups: R(nil, dummyErr)},
+			autoscalingMockOutputs{describeAutoScalingGroups: R(nil, errDummy)},
 			nil,
 			true,
 		},
@@ -156,7 +156,7 @@ func TestGetAutoScalingGroupsByName(t *testing.T) {
 		{
 			"autoscaling-api-failure",
 			[]string{"dontcare"},
-			autoscalingMockOutputs{describeAutoScalingGroups: R(nil, dummyErr)},
+			autoscalingMockOutputs{describeAutoScalingGroups: R(nil, errDummy)},
 			nil,
 			true,
 		},
@@ -192,7 +192,7 @@ func TestAttach(t *testing.T) {
 		{
 			name: "describe-lb-target-groups-failed",
 			responses: autoscalingMockOutputs{
-				describeLoadBalancerTargetGroups: R(nil, dummyErr),
+				describeLoadBalancerTargetGroups: R(nil, errDummy),
 			},
 			wantError: true,
 		},
@@ -210,7 +210,7 @@ func TestAttach(t *testing.T) {
 				detachLoadBalancerTargetGroups: R(nil, nil),
 			},
 			elbv2Response: elbv2MockOutputs{
-				describeTargetGroups: R(nil, dummyErr),
+				describeTargetGroups: R(nil, errDummy),
 			},
 			wantError: true,
 		},
@@ -229,7 +229,7 @@ func TestAttach(t *testing.T) {
 			},
 			elbv2Response: elbv2MockOutputs{
 				describeTargetGroups: R(nil, nil),
-				describeTags:         R(nil, dummyErr),
+				describeTags:         R(nil, errDummy),
 			},
 			wantError: true,
 		},
@@ -272,7 +272,7 @@ func TestAttach(t *testing.T) {
 		{
 			name: "failed-attach",
 			responses: autoscalingMockOutputs{
-				attachLoadBalancerTargetGroups: R(nil, dummyErr),
+				attachLoadBalancerTargetGroups: R(nil, errDummy),
 				describeLoadBalancerTargetGroups: R(&autoscaling.DescribeLoadBalancerTargetGroupsOutput{
 					LoadBalancerTargetGroups: []*autoscaling.LoadBalancerTargetGroupState{
 						{
@@ -390,7 +390,7 @@ func TestAttach(t *testing.T) {
 						},
 					},
 				}, nil),
-				detachLoadBalancerTargetGroups: R(nil, dummyErr),
+				detachLoadBalancerTargetGroups: R(nil, errDummy),
 			},
 			elbv2Response: elbv2MockOutputs{
 				describeTargetGroups: R(&elbv2.DescribeTargetGroupsOutput{
@@ -456,7 +456,7 @@ func TestDetach(t *testing.T) {
 	}{
 		{"success-detach", autoscalingMockOutputs{detachLoadBalancerTargetGroups: R(nil, nil)},
 			false},
-		{"failed-detach", autoscalingMockOutputs{detachLoadBalancerTargetGroups: R(nil, dummyErr)},
+		{"failed-detach", autoscalingMockOutputs{detachLoadBalancerTargetGroups: R(nil, errDummy)},
 			true},
 	} {
 		t.Run(fmt.Sprintf("%v", test.name), func(t *testing.T) {
diff --git a/aws/cf_test.go b/aws/cf_test.go
index beaa718..d938843 100644
--- a/aws/cf_test.go
+++ b/aws/cf_test.go
@@ -42,7 +42,7 @@ func TestCreatingStack(t *testing.T) {
 		{
 			"fail-call",
 			stackSpec{name: "foo", securityGroupID: "bar", vpcID: "baz"},
-			cfMockOutputs{createStack: R(nil, dummyErr)},
+			cfMockOutputs{createStack: R(nil, errDummy)},
 			"fake-stack-id",
 			true,
 		},
@@ -387,7 +387,7 @@ func TestFindManagedStacks(t *testing.T) {
 		{
 			"failed-paging",
 			cfMockOutputs{
-				describeStackPages: R(nil, dummyErr),
+				describeStackPages: R(nil, errDummy),
 				describeStacks:     R(&cloudformation.DescribeStacksOutput{}, nil),
 			},
 			nil,
@@ -396,7 +396,7 @@ func TestFindManagedStacks(t *testing.T) {
 		{
 			"failed-describe-page",
 			cfMockOutputs{
-				describeStacks: R(nil, dummyErr),
+				describeStacks: R(nil, errDummy),
 			},
 			nil,
 			true,
@@ -477,7 +477,7 @@ func TestGetStack(t *testing.T) {
 		{
 			"failed-paging",
 			cfMockOutputs{
-				describeStackPages: R(nil, dummyErr),
+				describeStackPages: R(nil, errDummy),
 				describeStacks:     R(&cloudformation.DescribeStacksOutput{}, nil),
 			},
 			nil,
@@ -486,7 +486,7 @@ func TestGetStack(t *testing.T) {
 		{
 			"failed-describe-page",
 			cfMockOutputs{
-				describeStacks: R(nil, dummyErr),
+				describeStacks: R(nil, errDummy),
 			},
 			nil,
 			true,
diff --git a/aws/ec2_test.go b/aws/ec2_test.go
index fa603fc..634151b 100644
--- a/aws/ec2_test.go
+++ b/aws/ec2_test.go
@@ -49,7 +49,7 @@ func TestFindingSecurityGroup(t *testing.T) {
 		},
 		{
 			"fail-with-aws-api-error",
-			ec2MockOutputs{describeSecurityGroups: R(nil, dummyErr)}, nil, true,
+			ec2MockOutputs{describeSecurityGroups: R(nil, errDummy)}, nil, true,
 		},
 	} {
 		t.Run(fmt.Sprintf("%v", test.name), func(t *testing.T) {
@@ -151,7 +151,7 @@ func TestGetInstanceDetails(t *testing.T) {
 		},
 		{
 			"aws-api-fail",
-			ec2MockOutputs{describeInstances: R(nil, dummyErr)},
+			ec2MockOutputs{describeInstances: R(nil, errDummy)},
 			nil,
 			true,
 		},
@@ -209,7 +209,7 @@ func TestGetSubnets(t *testing.T) {
 		},
 		{
 			"aws-sdk-failure-describing-subnets",
-			ec2MockOutputs{describeSubnets: R(nil, dummyErr)}, nil, true,
+			ec2MockOutputs{describeSubnets: R(nil, errDummy)}, nil, true,
 		},
 		{
 			"aws-sdk-failure-describing-route-tables",
@@ -218,7 +218,7 @@ func TestGetSubnets(t *testing.T) {
 					testSubnet{id: "foo1", name: "bar1", az: "baz1"},
 					testSubnet{id: "foo2", name: "bar2", az: "baz2"},
 				), nil),
-				describeRouteTables: R(nil, dummyErr),
+				describeRouteTables: R(nil, errDummy),
 			}, nil, true,
 		},
 		{
@@ -311,7 +311,7 @@ func TestGetInstancesDetailsWithFilters(t *testing.T) {
 					},
 				},
 			},
-			ec2MockOutputs{describeInstancesPages: mockDIPOutput(dummyErr, testInstance{})},
+			ec2MockOutputs{describeInstancesPages: mockDIPOutput(errDummy, testInstance{})},
 			nil,
 			true,
 		},
diff --git a/aws/elbv2_test.go b/aws/elbv2_test.go
index 85ec61b..b14cd5e 100644
--- a/aws/elbv2_test.go
+++ b/aws/elbv2_test.go
@@ -24,7 +24,7 @@ func TestRegisterTargetsOnTargetGroups(t *testing.T) {
 		registerTargets: R(mockRTOutput(), nil),
 	}
 	outputsError := elbv2MockOutputs{
-		registerTargets: R(mockRTOutput(), dummyErr),
+		registerTargets: R(mockRTOutput(), errDummy),
 	}
 
 	for _, test := range []struct {
@@ -117,7 +117,7 @@ func TestDeregisterTargetsOnTargetGroups(t *testing.T) {
 		deregisterTargets: R(mockDTOutput(), nil),
 	}
 	outputsError := elbv2MockOutputs{
-		deregisterTargets: R(mockDTOutput(), dummyErr),
+		deregisterTargets: R(mockDTOutput(), errDummy),
 	}
 
 	for _, test := range []struct {
diff --git a/aws/iam_test.go b/aws/iam_test.go
index 8b072cb..5808d10 100644
--- a/aws/iam_test.go
+++ b/aws/iam_test.go
@@ -44,7 +44,7 @@ func TestIAM(t *testing.T) {
 	foobarIAMCertificate := &iam.ServerCertificate{
 		CertificateBody: aws.String(mustRead("foo-iam.txt")),
 		ServerCertificateMetadata: &iam.ServerCertificateMetadata{
-			Arn: aws.String("foobar-arn"),
+			Arn:                   aws.String("foobar-arn"),
 			ServerCertificateName: aws.String("foobar"),
 		},
 	}
@@ -53,7 +53,7 @@ func TestIAM(t *testing.T) {
 		CertificateBody:  aws.String(mustRead("foo-iam.txt")),
 		CertificateChain: aws.String(mustRead("chain.txt")),
 		ServerCertificateMetadata: &iam.ServerCertificateMetadata{
-			Arn: aws.String("foobar-arn"),
+			Arn:                   aws.String("foobar-arn"),
 			ServerCertificateName: aws.String("foobar"),
 		},
 	}
@@ -63,7 +63,7 @@ func TestIAM(t *testing.T) {
 	zalandoIAMCertificate := &iam.ServerCertificate{
 		CertificateBody: aws.String(mustRead("zal-iam.txt")),
 		ServerCertificateMetadata: &iam.ServerCertificateMetadata{
-			Arn: aws.String("zalando-arn"),
+			Arn:                   aws.String("zalando-arn"),
 			ServerCertificateName: aws.String("zalando"),
 		},
 	}
@@ -208,8 +208,8 @@ func TestIAMParseError(t *testing.T) {
 			list: iam.ListServerCertificatesOutput{
 				ServerCertificateMetadataList: []*iam.ServerCertificateMetadata{
 					{
-						Arn:  aws.String("foobar-arn"),
-						Path: aws.String("/"),
+						Arn:                   aws.String("foobar-arn"),
+						Path:                  aws.String("/"),
 						ServerCertificateName: aws.String("foobar"),
 					},
 				},
diff --git a/aws/mocks_test.go b/aws/mocks_test.go
index 4a24fd6..f1a8e6f 100644
--- a/aws/mocks_test.go
+++ b/aws/mocks_test.go
@@ -11,7 +11,7 @@ type tags map[string]string
 
 type awsTags map[string]tags
 
-var dummyErr = errors.New("fail")
+var errDummy = errors.New("fail")
 
 func R(r interface{}, e error) *apiResponse {
 	return &apiResponse{response: r, err: e}