From ff9bb427688a4e704f947136c1e97cf033335869 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Wed, 10 Apr 2019 17:19:23 -0400 Subject: [PATCH 01/13] fix go.sum for checksum mismatch --- go.sum | 41 +---------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/go.sum b/go.sum index c2bf45b..afaaa90 100644 --- a/go.sum +++ b/go.sum @@ -1,29 +1,21 @@ -github.com/DataDog/datadog-go v0.0.0-20180822151419-281ae9f2d895 h1:dmc/C8bpE5VkQn65PNbbyACDC8xw8Hpp/NEurdPmQDQ= github.com/DataDog/datadog-go v0.0.0-20180822151419-281ae9f2d895/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go-v2 v0.6.0 h1:vIMDY9xzK+3lNyIQeS++URcvmDFI6reOalHhyjEb7W8= github.com/aws/aws-sdk-go-v2 v0.6.0/go.mod h1:Vb00pBiW2/e1Vi9eSv8ybD7uGD/S9+lLPMlpNoIFLgs= -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/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/circonus-labs/circonus-gometrics v2.2.4+incompatible h1:+ZwGzyJGsOwSxIEDDOXzPagR167tQak/1P5wBwH+/dM= github.com/circonus-labs/circonus-gometrics v2.2.4+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.2 h1:2jOJkxiDVNGbCtrwQwkZSvuguRLm3dZW2G2TyNltVN8= github.com/circonus-labs/circonusllhist v0.1.2/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gucumber/gucumber v0.0.0-20180127021336-7d5c79e832a2/go.mod h1:YbdHRK9ViqwGMS0rtRY+1I6faHvVyyurKPIPwifihxI= @@ -35,34 +27,24 @@ github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6K github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f h1:Yv9YzBlAETjy6AOX9eLBZ3nshNVRREgerT/3nvxlGho= github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.0.0-20150518234257-fa3f63826f7c h1:BTAbnbegUIMB6xmQCwWE8yRzbA4XSpnZY5hvRJC188I= github.com/hashicorp/go-msgpack v0.0.0-20150518234257-fa3f63826f7c/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-retryablehttp v0.5.0 h1:aVN0FYnPwAgZI/hVzqwfMiM86ttcHTlQKbBVeVmXPIs= github.com/hashicorp/go-retryablehttp v0.5.0/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90 h1:9HVkPxOpo+yO93Ah4yrO67d/qh0fbLLWbKqhYjyHq9A= +github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90 h1:VBj0QYQ0u2MCJzBfeYXGexnAl17GsH1yidnoxCqqD9E= github.com/hashicorp/go-rootcerts v0.0.0-20160503143440-6bb64b370b90/go.mod h1:o4zcYY1e0GEZI6eSEr+43QDYmuGglw1qSO6qdHUHCgg= -github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86 h1:7YOlAIO2YWnJZkQp7B5eFykaIY7C9JndqAFQyVV5BhM= github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/memberlist v0.1.0 h1:qSsCiC0WYD39lbSitKNt40e30uorm2Ss/d4JGU1hzH8= github.com/hashicorp/memberlist v0.1.0/go.mod h1:ncdBp14cuox2iFOq3kDiquKU6fqsTBc3W6JvZwjxxsE= github.com/hashicorp/serf v0.8.1 h1:mYs6SMzu72+90OcPa5wr3nfznA4Dw9UyR791ZFNOIf4= github.com/hashicorp/serf v0.8.1/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -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= @@ -71,61 +53,40 @@ github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRU github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -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/miekg/dns v1.0.15 h1:9+UupePBQCG6zf1q/bGmTO1vumoG13jsrbWOSX1W6Tw= github.com/miekg/dns v1.0.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -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/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v0.9.1 h1:K47Rk0v/fkEfwfQet2KWhscE0cJzjgCCDBG2KHZoVno= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/common v0.0.0-20181120120127-aeab699e26f4 h1:JN8iUqOgmRYninFWhPhdVhcxlJez35ZKpjibROwPiNA= github.com/prometheus/common v0.0.0-20181120120127-aeab699e26f4/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d h1:GoAlyOgbOEIFdaDqxJVlbOQ1DtGmZWs/Qau0hIlk+WQ= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg= github.com/smartystreets/assertions v0.0.0-20180820201707-7c9eb446e3cf/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c h1:Ho+uVpkel/udgjbwB5Lktg9BtvJSh2DT0Hi6LPSyI2w= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869 h1:kkXA53yGe04D0adEYJwEVQjeBppL01Exg+fnMjfUraU= golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc h1:MeuS1UDyZyFH++6vVy44PuufTeFF0d0nfI6XB87YGSk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.3.0 h1:FBSsiFRMz3LBeXIomRnVzrQwSDj4ibvcRexLG0LZGQk= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -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/vmihailenco/msgpack.v2 v2.9.1 h1:kb0VV7NuIojvRfzwslQeP3yArBqJHW9tOl4t38VS1jM= gopkg.in/vmihailenco/msgpack.v2 v2.9.1/go.mod h1:/3Dn1Npt9+MYyLpYYXjInO/5jvMLamn+AEGwNEOatn8= From f8cf048e87ac7406fced3839d6fbc84b73c89878 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Thu, 11 Apr 2019 23:14:28 -0400 Subject: [PATCH 02/13] remove gocov tools --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4fbc2e9..1d2d844 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,7 @@ GOTOOLS = \ github.com/magiconair/vendorfmt/cmd/vendorfmt \ github.com/mitchellh/gox \ golang.org/x/tools/cmd/cover \ - golang.org/x/tools/cmd/stringer \ - github.com/axw/gocov/gocov \ - gopkg.in/matm/v1/gocov-html + golang.org/x/tools/cmd/stringer DEV_IMAGE?=consul-aws-dev GO_BUILD_TAG?=consul-aws-build-go From b22a8a7dfe8586b02f6f0096c063e18dc7f4f539 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Thu, 11 Apr 2019 18:43:24 -0400 Subject: [PATCH 03/13] fix error statement --- catalog/sync_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog/sync_test.go b/catalog/sync_test.go index 92b8a5f..4ddef0b 100644 --- a/catalog/sync_test.go +++ b/catalog/sync_test.go @@ -42,7 +42,7 @@ func runSyncTest(t *testing.T, namespaceID string) { err = createServiceInConsul(c, cID, cName) if err != nil { - t.Fatalf("error creating service in aws: %s", err) + t.Fatalf("error creating service in Consul: %s", err) } aID, err := createServiceInAWS(a, namespaceID, aName) From c8272769d9bf12bfd878b5a2a9b79201d4cf6dbd Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Wed, 10 Apr 2019 17:19:31 -0400 Subject: [PATCH 04/13] add circleci config --- .circleci/config.yml | 117 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..2b6fe93 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,117 @@ +version: 2.1 + +references: + images: + go: &GOLANG_IMAGE circleci/golang:1.12.1 + consul-current: &CONSUL_IMAGE_CURRENT consul:1.4.4 + consul-previous: &CONSUL_IMAGE_PREVIOUS consul:1.4.3 + +# reusable 'executor' object for jobs +executors: + go: + docker: + - image: *GOLANG_IMAGE + environment: + - TEST_RESULTS: /tmp/test-results # path to where test results are saved + +jobs: + go-fmt-and-vet: + executor: go + steps: + - checkout + + # Restore go module cache if there is one + - restore_cache: + keys: + - consul-aws-modcache-v1-{{ checksum "go.mod" }} + + - run: go mod download + + # Save go module cache if the go.mod file has changed + - save_cache: + key: consul-aws-modcache-v1-{{ checksum "go.mod" }} + paths: + - "/go/pkg/mod" + + # check go fmt output because it does not report non-zero when there are fmt changes + - run: + name: check go fmt + command: | + files=$(go fmt ./...) + if [ -n "$files" ]; then + echo "The following file(s) do not conform to go fmt:" + echo "$files" + exit 1 + fi + - run: go vet ./... + + test: + parameters: + consul-version: + description: What version of Consul to test against + type: string + executor: go + environment: + NAMESPACEID: ns-btldyxsz7rymvf4x # AWS Cloud Map Namespace for CI + NAMESPACEIDHTTP: ns-dhshakmjzetizgi2 # AWS Cloud Map Namespace for CI + docker: # the docker stanza will overwrite the executor so we need to define GOLANG_IMAGE again here + - image: *GOLANG_IMAGE + - image: << parameters.consul-version >> + parallelism: 1 # make this explicit in case we need to parallelize in the future + steps: + - checkout + - run: mkdir -p $TEST_RESULTS + + # Restore go module cache if there is one + - restore_cache: + keys: + - consul-aws-modcache-v1-{{ checksum "go.mod" }} + + # run go tests with gotestsum + - run: | + PACKAGE_NAMES=$(go list ./...) + gotestsum --format=short-verbose --junitfile $TEST_RESULTS/gotestsum-report.xml -- $PACKAGE_NAMES + - store_test_results: + path: /tmp/test-results + - store_artifacts: + path: /tmp/test-results + + build-distros: + executor: go + environment: + GOXPARALLEL: 2 # CircleCI containers are 2 CPU x 4GB RAM + steps: + - checkout + + # Restore go module cache if there is one + - restore_cache: + keys: + - consul-aws-modcache-v1-{{ checksum "go.mod" }} + + - run: make tools + - run: ./build-support/scripts/build-local.sh + + # save dev build to CircleCI + - store_artifacts: + path: ./pkg/bin + +workflows: + version: 2 + test-and-build: + jobs: + - go-fmt-and-vet + - test: + name: test-previous-consul-version + consul-version: *CONSUL_IMAGE_PREVIOUS + requires: + - go-fmt-and-vet + - test: + name: test-current-consul-version + consul-version: *CONSUL_IMAGE_CURRENT + # The resources created in the tests with the two consul versions are the same + # This can be changed to run in parallel once a prefix/uniqueness is added to the tests + requires: + - test-previous-consul-version + - build-distros: + requires: + - test-current-consul-version \ No newline at end of file From 9a26f484ca8e8aae570b577173bd5b0d4cd0267d Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Fri, 19 Apr 2019 14:07:09 -0400 Subject: [PATCH 05/13] use golang 1.12.4 --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2b6fe93..01fc709 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2.1 references: images: - go: &GOLANG_IMAGE circleci/golang:1.12.1 + go: &GOLANG_IMAGE circleci/golang:1.12.4 consul-current: &CONSUL_IMAGE_CURRENT consul:1.4.4 consul-previous: &CONSUL_IMAGE_PREVIOUS consul:1.4.3 @@ -114,4 +114,4 @@ workflows: - test-previous-consul-version - build-distros: requires: - - test-current-consul-version \ No newline at end of file + - test-current-consul-version From 0ff0c7917b2619aa2d33a752994beb0da01d8732 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Fri, 19 Apr 2019 17:15:39 -0400 Subject: [PATCH 06/13] add a version label to Dockerfile for introspection in build script --- build-support/docker/Release.dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-support/docker/Release.dockerfile b/build-support/docker/Release.dockerfile index 589a0ae..75c03eb 100644 --- a/build-support/docker/Release.dockerfile +++ b/build-support/docker/Release.dockerfile @@ -19,6 +19,9 @@ ENV VERSION=$VERSION # This is the location of the releases. ENV HASHICORP_RELEASES=https://releases.hashicorp.com +# Add a label for introspection of version +LABEL version=$VERSION + # Create a non-root user to run the software. RUN addgroup ${NAME} && \ adduser -S -G ${NAME} ${NAME} From 4f45722395a37483144cf754018d934b50fc273c Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Fri, 19 Apr 2019 17:16:10 -0400 Subject: [PATCH 07/13] add make target for publishing a Dockerfile --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1d2d844..762e09f 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,12 @@ GIT_DESCRIBE?=$(shell git describe --tags --always) GIT_IMPORT=github.com/hashicorp/consul-aws/version GOLDFLAGS=-X $(GIT_IMPORT).GitCommit=$(GIT_COMMIT)$(GIT_DIRTY) -X $(GIT_IMPORT).GitDescribe=$(GIT_DESCRIBE) +# Docker Image publishing variables +DOCKER_IMAGE_NAME=consul-aws +DOCKER_ORG=hashicorp +export DOCKER_IMAGE_NAME +export DOCKER_ORG + export GIT_COMMIT export GIT_DIRTY export GIT_DESCRIBE @@ -103,10 +109,14 @@ go-build-image: @echo "Building Golang build container" @docker build $(NOCACHE) $(QUIET) --build-arg 'GOTOOLS=$(GOTOOLS)' -t $(GO_BUILD_TAG) - < build-support/docker/Build-Go.dockerfile +docker-publish: + @echo "Building Docker Image" + @$(SHELL) $(CURDIR)/build-support/scripts/publish-docker.sh + clean: @rm -rf \ $(CURDIR)/bin \ $(CURDIR)/pkg -.PHONY: all bin clean dev dist docker-images go-build-image test tools +.PHONY: all bin clean dev dist docker-images go-build-image test tools docker-publish From d3e0616841989111043612e9ae74e46c0510a2b0 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Fri, 19 Apr 2019 17:17:14 -0400 Subject: [PATCH 08/13] add circleci config for dockerfile linting and building on tags --- .circleci/config.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 01fc709..1f5cdb2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -95,6 +95,38 @@ jobs: - store_artifacts: path: ./pkg/bin + # Lints all *.dockerfile but don't fail at this time + dockerfile-lint: + docker: + - image: hadolint/hadolint:latest-debian + steps: + - run: apt-get -qq update; apt-get -y install git # the hadolint container doesn't have git + - checkout + - run: + name: Dockefile lint + command: | + for file in $(find . -type f -name *.dockerfile); do + hadolint $file || true + done + + # Builds and publishes Docker Container to Dockerhub for tagged releases + docker-build: + executor: go + steps: + - checkout + - setup_remote_docker: + docker_layer_caching: true + - run: + name: wait for release package + command: | + CONSUL_AWS_VERSION=$(echo ${CIRCLE_TAG} | sed 's/v\(.*\)/\1/') + echo "curl-ing https://releases.hashicorp.com/${CIRCLE_PROJECT_REPONAME}/${CONSUL_AWS_VERSION}/${CIRCLE_PROJECT_REPONAME}_${CONSUL_AWS_VERSION}_linux_amd64.zip" + until [ $SECONDS -ge 300 ] && exit 1; do + curl -o /dev/null --fail --silent "https://releases.hashicorp.com/${CIRCLE_PROJECT_REPONAME}/${CONSUL_AWS_VERSION}/${CIRCLE_PROJECT_REPONAME}_${CONSUL_AWS_VERSION}_linux_amd64.zip" && exit + echo -n "." + sleep 2 + done + - run: make docker-publish workflows: version: 2 test-and-build: @@ -115,3 +147,17 @@ workflows: - build-distros: requires: - test-current-consul-version + docker-build-and-publish: + jobs: + - dockerfile-lint: + filters: + tags: + only: /^v\d+\.\d+\.\d+$/ + - docker-build: + requires: + - dockerfile-lint + filters: + tags: + only: /^v\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ From 40bcab8cdbbbe9e2fe9ea4ef89c8b7393f7f2625 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Fri, 19 Apr 2019 17:17:55 -0400 Subject: [PATCH 09/13] add docker publishing script --- build-support/scripts/publish-docker.sh | 111 ++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 build-support/scripts/publish-docker.sh diff --git a/build-support/scripts/publish-docker.sh b/build-support/scripts/publish-docker.sh new file mode 100644 index 0000000..184aee9 --- /dev/null +++ b/build-support/scripts/publish-docker.sh @@ -0,0 +1,111 @@ +#!/bin/bash + +# Description: +# This script will publish consul-aws containers to Dockerhub. It should only run on tagged +# branches within CI and all the variables needed are populated either by CircleCI or the Makefile. + +# To publish a new container, make sure the following environment variables are set: +# * CIRCLE_TAG - the version of the consul-aws binary you want to build an image for +# * DOCKER_ORG - to the organization of the docker image +# * DOCKER_IMAGE_NAME - to the name of the docker image + +function get_latest_docker_version { + # Arguments: + # $1 - Docker Org + # $2 - Docker Image Name + # + # + # Returns: + # 0 - success (version in the 'latest' container echoed) + # 1 - 'latest' tag does not exist or label could not be found + + docker_latest=$(docker inspect --format='{{ index .Config.Labels "version" }}' "$1"/"$2":latest 2> /dev/null) + + if [ -z "$docker_latest" ]; then + return 1 + else + echo "$docker_latest" + return 0 + fi +} + +function get_latest_docker_minor_version { + # Arguments: + # $1 - Docker Org + # $2 - Docker Image Name + # $3 - Minor Version Tag + # + # Returns: + # 0 - success (version in the latest minor version container echoed) + # 1 - tag does not exist or label could not be found + docker_latest_minor=$(docker inspect --format='{{ index .Config.Labels "version" }}' "$1"/"$2":"$3" 2> /dev/null) + + if [ -z "$docker_latest_minor" ]; then + return 1 + else + echo "$docker_latest_minor" + return 0 + fi +} + +function higher_version { + # Arguments: + # $1 - first version to compare + # $2 - second version to compare + # + # Returns: + # higher version of two arguments + + higher_version=$(echo -e "$1\n$2" | sort -rV | head -n 1) + echo "$higher_version" +} +function main() { + # check for necessary variables + : "${CIRCLE_TAG?"Need to set CIRCLE_TAG"}" + : "${DOCKER_ORG?"Need to set DOCKER_ORG"}" + : "${DOCKER_IMAGE_NAME?"Need to set DOCKER_IMAGE_NAME"}" + + # trims v from version, ex: v1.2.3 -> 1.2.3; this maps to releases.hashicorp.com + CURRENT_TAG_VERSION=$(echo "$CIRCLE_TAG" | sed 's/v\(.*\)/\1/') + + # trims the patch part of the git tag to compare + MINOR_VERSION=${CIRCLE_TAG%.[0-9]*} + DOCKER_MINOR_TAG="${MINOR_VERSION#v}-latest" + + LATEST_DOCKER_MINOR_VERSION=$(get_latest_docker_minor_version "$DOCKER_ORG" "$DOCKER_IMAGE_NAME" "$DOCKER_MINOR_TAG") + LATEST_DOCKER_VERSION=$(get_latest_docker_version "$DOCKER_ORG" "$DOCKER_IMAGE_NAME") + + # Login to Dockerhub + docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" + + # build current branch tag image + docker build -t "$DOCKER_ORG"/"$DOCKER_IMAGE_NAME":"$CURRENT_TAG_VERSION" --build-arg NAME="$DOCKER_IMAGE_NAME" --build-arg VERSION="$CURRENT_TAG_VERSION" -f "$(pwd)"/build-support/docker/Release.dockerfile "$(pwd)"/build-support/docker + docker push "$DOCKER_ORG"/"$DOCKER_IMAGE_NAME":"$CURRENT_TAG_VERSION" + + # check to see if the current tag is higher than the latest minor version on dockerhub + HIGHER_MINOR_VERSION=$(higher_version "$CURRENT_TAG_VERSION" "$LATEST_DOCKER_MINOR_VERSION") + + # if the higher version is the current tag, we tag the current image with the minor tag + if [ "$HIGHER_MINOR_VERSION" = "$CURRENT_TAG_VERSION" ]; then + echo "Tagging a new minor latest image" + docker tag "$DOCKER_ORG"/"$DOCKER_IMAGE_NAME":"$CURRENT_TAG_VERSION" "$DOCKER_ORG"/"$DOCKER_IMAGE_NAME":"$DOCKER_MINOR_TAG" + docker push "$DOCKER_ORG"/"$DOCKER_IMAGE_NAME":"$DOCKER_MINOR_TAG" + fi + + # check to see if the current tag is higher than the latest version on dockerhub + HIGHER_LATEST_VERSION=$(higher_version "$CURRENT_TAG_VERSION" "$LATEST_DOCKER_VERSION") + + # if: + # * we didn't find a version from the 'latest' image, it means it doesn't exist + # * or if the current tag version is higher than the latest docker one + # we build latest + if [ -z "$LATEST_DOCKER_VERSION" ] || [ "$HIGHER_LATEST_VERSION" = "$CURRENT_TAG_VERSION" ]; then + echo "Tagging a new latest docker image" + docker tag "$DOCKER_ORG"/"$DOCKER_IMAGE_NAME":"$CURRENT_TAG_VERSION" "$DOCKER_ORG"/"$DOCKER_IMAGE_NAME":latest + docker push "$DOCKER_ORG"/"$DOCKER_IMAGE_NAME":latest + fi + + return 0 +} +main "$@" +exit $? \ No newline at end of file From 9cfe5403440ca54423f77918b8470f0101fbe6ae Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Fri, 19 Apr 2019 17:52:37 -0400 Subject: [PATCH 10/13] use an ENTRYPOINT instead of a CMD for published docker --- build-support/docker/Release.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-support/docker/Release.dockerfile b/build-support/docker/Release.dockerfile index 75c03eb..0c2e7ac 100644 --- a/build-support/docker/Release.dockerfile +++ b/build-support/docker/Release.dockerfile @@ -62,4 +62,4 @@ RUN set -eux && \ rm -rf /root/.gnupg USER ${NAME} -CMD /bin/${NAME} +ENTRYPOINT /bin/${NAME} From c04b71ec3067627f5f15005bc55b76214fac882f Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Tue, 23 Apr 2019 13:38:20 -0400 Subject: [PATCH 11/13] go.sum updates --- go.sum | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go.sum b/go.sum index afaaa90..e6ddc85 100644 --- a/go.sum +++ b/go.sum @@ -9,6 +9,7 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/circonus-labs/circonus-gometrics v2.2.4+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.2/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -64,6 +65,7 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 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/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -76,6 +78,7 @@ github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/ github.com/smartystreets/assertions v0.0.0-20180820201707-7c9eb446e3cf/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= From a7e91f02b6525a082853936a21bba81724af53a5 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Tue, 23 Apr 2019 13:59:40 -0400 Subject: [PATCH 12/13] make INTTEST requirement more clear --- catalog/sync_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog/sync_test.go b/catalog/sync_test.go index 4ddef0b..8f2f93d 100644 --- a/catalog/sync_test.go +++ b/catalog/sync_test.go @@ -14,7 +14,7 @@ import ( func TestSync(t *testing.T) { if len(os.Getenv("INTTEST")) == 0 { - t.Skip("no int test env") + t.Skip("Set INTTEST=1 to enable integration tests") } namespaceID := os.Getenv("NAMESPACEID") if len(namespaceID) == 0 { From b5a959cad31de10af07137c5aac2dcca41d97c60 Mon Sep 17 00:00:00 2001 From: Alvin Huang Date: Tue, 23 Apr 2019 14:08:42 -0400 Subject: [PATCH 13/13] use the consul-aws.version LABEL --- build-support/docker/Release.dockerfile | 2 +- build-support/scripts/publish-docker.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-support/docker/Release.dockerfile b/build-support/docker/Release.dockerfile index 0c2e7ac..d2351a9 100644 --- a/build-support/docker/Release.dockerfile +++ b/build-support/docker/Release.dockerfile @@ -20,7 +20,7 @@ ENV VERSION=$VERSION ENV HASHICORP_RELEASES=https://releases.hashicorp.com # Add a label for introspection of version -LABEL version=$VERSION +LABEL consul-aws.version=$VERSION # Create a non-root user to run the software. RUN addgroup ${NAME} && \ diff --git a/build-support/scripts/publish-docker.sh b/build-support/scripts/publish-docker.sh index 184aee9..9ce0680 100644 --- a/build-support/scripts/publish-docker.sh +++ b/build-support/scripts/publish-docker.sh @@ -19,7 +19,7 @@ function get_latest_docker_version { # 0 - success (version in the 'latest' container echoed) # 1 - 'latest' tag does not exist or label could not be found - docker_latest=$(docker inspect --format='{{ index .Config.Labels "version" }}' "$1"/"$2":latest 2> /dev/null) + docker_latest=$(docker inspect --format='{{ index .Config.Labels "consul-aws.version" }}' "$1"/"$2":latest 2> /dev/null) if [ -z "$docker_latest" ]; then return 1 @@ -38,7 +38,7 @@ function get_latest_docker_minor_version { # Returns: # 0 - success (version in the latest minor version container echoed) # 1 - tag does not exist or label could not be found - docker_latest_minor=$(docker inspect --format='{{ index .Config.Labels "version" }}' "$1"/"$2":"$3" 2> /dev/null) + docker_latest_minor=$(docker inspect --format='{{ index .Config.Labels "consul-aws.version" }}' "$1"/"$2":"$3" 2> /dev/null) if [ -z "$docker_latest_minor" ]; then return 1