From 082bfaed23ac10fdf4a18c3f8c0622b20e589cf4 Mon Sep 17 00:00:00 2001 From: Dustin Decker Date: Fri, 13 Nov 2020 11:15:00 -0800 Subject: [PATCH] Fix the build Signed-off-by: Dustin Decker --- Dockerfile | 15 ++--- Gopkg.lock | 147 ---------------------------------------------- Gopkg.toml | 25 -------- app/carbonbeat.go | 2 +- go.sum | 63 ++++++++++++++++++++ 5 files changed, 69 insertions(+), 183 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml create mode 100644 go.sum diff --git a/Dockerfile b/Dockerfile index 5d01cdd..0d80039 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,15 @@ # Build stage -ARG GO_VERSION=1.8 -ARG PROJECT_PATH=/go/src/github.com/indeedsecurity/carbonbeat -FROM golang:${GO_VERSION}-alpine AS builder -RUN apk --no-cache add ca-certificates tini git gcc musl-dev -RUN go get -u github.com/golang/dep/cmd/dep -WORKDIR /go/src/github.com/indeedsecurity/carbonbeat -COPY ./ ${PROJECT_PATH} -RUN dep ensure +FROM golang:1.15-buster as builder +WORKDIR /build +COPY . . RUN CGO_ENABLED=0 GOOS=`go env GOHOSTOS` GOARCH=`go env GOHOSTARCH` go build -o carbonbeat \ && go test $(go list ./... | grep -v /vendor/) # Production image -FROM alpine:3.6 +FROM alpine:3.12 RUN apk --no-cache add ca-certificates tini WORKDIR / -COPY --from=builder /go/src/github.com/indeedsecurity/carbonbeat/carbonbeat . +COPY --from=builder /build/carbonbeat . RUN adduser -D -u 69999 -s /usr/sbin/nologin carbonbeat #USER carbonbeat ENTRYPOINT ["tini", "-g", "--"] diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index f023632..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,147 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - name = "github.com/Shopify/sarama" - packages = ["."] - revision = "c01858abb625b73a3af51d0798e4ad42c8147093" - version = "v1.12.0" - -[[projects]] - name = "github.com/davecgh/go-spew" - packages = ["spew"] - revision = "346938d642f2ec3594ed81d874461961cd0faa76" - version = "v1.1.0" - -[[projects]] - name = "github.com/eapache/go-resiliency" - packages = ["breaker"] - revision = "6800482f2c813e689c88b7ed3282262385011890" - version = "v1.0.0" - -[[projects]] - branch = "master" - name = "github.com/eapache/go-xerial-snappy" - packages = ["."] - revision = "bb955e01b9346ac19dc29eb16586c90ded99a98c" - -[[projects]] - name = "github.com/eapache/queue" - packages = ["."] - revision = "ded5959c0d4e360646dc9e9908cff48666781367" - version = "v1.0.2" - -[[projects]] - name = "github.com/elastic/beats" - packages = ["libbeat/beat","libbeat/cfgfile","libbeat/common","libbeat/common/dtfmt","libbeat/common/file","libbeat/common/fmtstr","libbeat/common/jsontransform","libbeat/common/match","libbeat/common/op","libbeat/common/streambuf","libbeat/dashboards/dashboards","libbeat/logp","libbeat/monitoring","libbeat/monitoring/adapter","libbeat/outputs","libbeat/outputs/codecs/format","libbeat/outputs/codecs/json","libbeat/outputs/console","libbeat/outputs/elasticsearch","libbeat/outputs/fileout","libbeat/outputs/kafka","libbeat/outputs/logstash","libbeat/outputs/mode","libbeat/outputs/mode/lb","libbeat/outputs/mode/modeutil","libbeat/outputs/mode/single","libbeat/outputs/outil","libbeat/outputs/redis","libbeat/outputs/transport","libbeat/paths","libbeat/plugin","libbeat/processors","libbeat/processors/actions","libbeat/processors/add_cloud_metadata","libbeat/publisher","libbeat/service","libbeat/setup/kibana","metricbeat/schema","metricbeat/schema/mapstriface"] - revision = "3e0b7a36227e7dc359b1f999676100c3c42d3898" - version = "v5.6.2" - -[[projects]] - name = "github.com/elastic/go-lumber" - packages = ["client/v2","log","protocol/v2"] - revision = "616041e345fc33c97bc0eb0fa6b388aa07bca3e1" - version = "v0.1.0" - -[[projects]] - name = "github.com/elastic/go-ucfg" - packages = [".","cfgutil","flag","internal/parse","json","yaml"] - revision = "ec8488a52542c0c51e42e8ea204dcaff400bc644" - version = "v0.4.6" - -[[projects]] - name = "github.com/garyburd/redigo" - packages = ["internal","redis"] - revision = "433969511232c397de61b1442f9fd49ec06ae9ba" - version = "v1.1.0" - -[[projects]] - branch = "master" - name = "github.com/golang/snappy" - packages = ["."] - revision = "553a641470496b2327abcac10b36396bd98e45c9" - -[[projects]] - branch = "master" - name = "github.com/joeshaw/multierror" - packages = ["."] - revision = "69b34d4ec901851247ae7e77d33909caf9df99ed" - -[[projects]] - name = "github.com/klauspost/compress" - packages = ["flate","zlib"] - revision = "6c8db69c4b49dd4df1fff66996cf556176d0b9bf" - version = "v1.2.1" - -[[projects]] - name = "github.com/klauspost/cpuid" - packages = ["."] - revision = "ae7887de9fa5d2db4eaa8174a7eff2c1ac00f2da" - version = "v1.1" - -[[projects]] - branch = "master" - name = "github.com/mitchellh/hashstructure" - packages = ["."] - revision = "2bca23e0e452137f789efbc8610126fd8b94f73b" - -[[projects]] - branch = "master" - name = "github.com/nranchev/go-libGeoIP" - packages = ["."] - revision = "d6d4a9a4c7e8d750064c10550bbd4f9aae50d48e" - -[[projects]] - name = "github.com/pierrec/lz4" - packages = ["."] - revision = "08c27939df1bd95e881e2c2367a749964ad1fceb" - version = "v1.0.1" - -[[projects]] - name = "github.com/pierrec/xxHash" - packages = ["xxHash32"] - revision = "f051bb7f1d1aaf1b5a665d74fb6b0217712c69f7" - version = "v0.1.1" - -[[projects]] - name = "github.com/pkg/errors" - packages = ["."] - revision = "645ef00459ed84a119197bfb8d8205042c6df63d" - version = "v0.8.0" - -[[projects]] - branch = "master" - name = "github.com/rcrowley/go-metrics" - packages = [".","exp"] - revision = "1f30fe9094a513ce4c700b9a54458bbb0c96996c" - -[[projects]] - name = "github.com/satori/go.uuid" - packages = ["."] - revision = "879c5887cd475cd7864858769793b2ceb0d44feb" - version = "v1.1.0" - -[[projects]] - branch = "master" - name = "golang.org/x/net" - packages = ["proxy"] - revision = "0a9397675ba34b2845f758fe3cd68828369c6517" - -[[projects]] - branch = "master" - name = "golang.org/x/sys" - packages = ["windows","windows/svc","windows/svc/debug"] - revision = "314a259e304ff91bd6985da2a7149bbf91237993" - -[[projects]] - branch = "v2" - name = "gopkg.in/yaml.v2" - packages = ["."] - revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "77a8f3afdcd500db7158c723fbf927c2473276ce06b8c76c3e2f2e3b6d09a37b" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 9940ed4..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,25 +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" - -[[constraint]] - name = "github.com/elastic/beats" - version = "5.6.2" diff --git a/app/carbonbeat.go b/app/carbonbeat.go index 0f510a1..f8c635f 100644 --- a/app/carbonbeat.go +++ b/app/carbonbeat.go @@ -99,7 +99,7 @@ func (bt *Carbonbeat) Run(b *beat.Beat) error { func (bt *Carbonbeat) Stop() { err := bt.client.Close() if err != nil { - logp.Critical("stopping the beat client failed because of: ", err) + logp.Critical(fmt.Sprintf("stopping the beat client failed because of: %s", err.Error())) } close(bt.done) } diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..c9a393c --- /dev/null +++ b/go.sum @@ -0,0 +1,63 @@ +github.com/Shopify/sarama v1.12.0 h1:SGfRgQ8Qq7DfnoAzGEQDssnqz5ZHl7cmpzpJKLj3UwQ= +github.com/Shopify/sarama v1.12.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +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/eapache/go-resiliency v1.0.0 h1:XPZo5qMI0LGzIqT9wRq6dPv2vEuo9MWCar1wHY8Kuf4= +github.com/eapache/go-resiliency v1.0.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20160609142408-bb955e01b934 h1:oGLoaVIefp3tiOgi7+KInR/nNPvEpPM6GFo+El7fd14= +github.com/eapache/go-xerial-snappy v0.0.0-20160609142408-bb955e01b934/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.0.2 h1:jRJXCx6uciOfN69MfZCC9EZlGRqqHhwlyb6GBeNow+c= +github.com/eapache/queue v1.0.2/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/elastic/beats v5.6.2+incompatible h1:4gztCxDzpjpiPXqxhKRNPm+hXuPrM+byOAX2KWpINeQ= +github.com/elastic/beats v5.6.2+incompatible/go.mod h1:7cX7zGsOwJ01FLkZs9Tg5nBdnQi6XB3hYAyWekpKgeY= +github.com/elastic/go-lumber v0.1.0 h1:HUjpyg36v2HoKtXlEC53EJ3zDFiDRn65d7B8dBHNius= +github.com/elastic/go-lumber v0.1.0/go.mod h1:8YvjMIRYypWuPvpxx7WoijBYdbB7XIh/9FqSYQZTtxQ= +github.com/elastic/go-ucfg v0.4.6 h1:Y2lmRGOn2eliyLiW+aTITaB+RnvIPt7W1f5u006/oUw= +github.com/elastic/go-ucfg v0.4.6/go.mod h1:iaiY0NBIYeasNgycLyTvhJftQlQEUO2hpF+FX0JKxzo= +github.com/garyburd/redigo v1.1.0 h1:kTY6M1SUxdOiFU4rbXWTtDBsTnfsXo4vDhXzhGMjdwk= +github.com/garyburd/redigo v1.1.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/golang/snappy v0.0.0-20170215233205-553a64147049 h1:K9KHZbXKpGydfDN0aZrsoHpLJlZsBrGMFWbgLDGnPZk= +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 h1:rp+c0RAYOWj8l6qbCUTSiRLG/iKnW3K3/QfPPuSsBt4= +github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= +github.com/klauspost/compress v1.2.1 h1:z1Ra6IKoPtIeVA8GV0SCQhuo6T4EBjlL9VwonZ8NYBo= +github.com/klauspost/compress v1.2.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= +github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452 h1:hOY53G+kBFhbYFpRVxHl5eS7laP6B1+Cq+Z9Dry1iMU= +github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/nranchev/go-libGeoIP v0.0.0-20170629073846-d6d4a9a4c7e8 h1:IeI4GVfCGrGx4tZROZ/ju+nO9rKpgKJ7o4XmQgAM/2g= +github.com/nranchev/go-libGeoIP v0.0.0-20170629073846-d6d4a9a4c7e8/go.mod h1:CSS25pAr1pT+qxFdpFZIJFHraF4zZfZYeFirlVvLXb4= +github.com/pierrec/lz4 v1.0.1 h1:w6GMGWSsCI04fTM8wQRdnW74MuJISakuUU0onU0TYB4= +github.com/pierrec/lz4 v1.0.1/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/xxHash v0.1.1 h1:KP4NrV9023xp3M4FkTYfcXqWigsOCImL1ANJ7sh5vg4= +github.com/pierrec/xxHash v0.1.1/go.mod h1:w2waW5Zoa/Wc4Yqe0wgrIYAGKqRMf7czn2HNKXmuL+I= +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/rcrowley/go-metrics v0.0.0-20161128210544-1f30fe9094a5 h1:gwcdIpH6NU2iF8CmcqD+CP6+1CkRBOhHaPR+iu6raBY= +github.com/rcrowley/go-metrics v0.0.0-20161128210544-1f30fe9094a5/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/satori/go.uuid v1.1.0 h1:B9KXyj+GzIpJbV7gmr873NsY6zpbxNy24CBtGrk7jHo= +github.com/satori/go.uuid v1.1.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +golang.org/x/net v0.0.0-20170927055102-0a9397675ba3 h1:tTDpczhDVjW6WN3DinzKcw5juwkDTVn22I7MNlfxSXM= +golang.org/x/net v0.0.0-20170927055102-0a9397675ba3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sys v0.0.0-20170927054621-314a259e304f h1:iUy6hSM2lPBGm2d9HgXq1GqYPwcJvA8ihnWauXggYMs= +golang.org/x/sys v0.0.0-20170927054621-314a259e304f/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=