From 364b0d3485681d0dd903a1cd6a4d7e642858b868 Mon Sep 17 00:00:00 2001 From: Ilya Kheifets <138466237+ikheifets-splunk@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:04:41 +0200 Subject: [PATCH 01/12] go: bump version on 1.22 (#953) Signed-off-by: Ilya Kheifets --- .travis.yml | 2 +- Dockerfile | 2 +- go.mod | 39 ++++++++++++++++++++------------------- go.sum | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index f18455cb..f6cbb803 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: go go: - - 1.21.x + - 1.22.x os: - osx diff --git a/Dockerfile b/Dockerfile index 93a143a3..73e4f50d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.21 +ARG GO_VERSION=1.22 FROM docker.io/golang:${GO_VERSION}-alpine AS base diff --git a/go.mod b/go.mod index 959bbba8..7e88ac01 100644 --- a/go.mod +++ b/go.mod @@ -1,25 +1,25 @@ module github.com/goss-org/goss -go 1.21 +go 1.22 require ( github.com/Masterminds/sprig/v3 v3.2.3 github.com/achanda/go-sysctl v0.0.0-20160222034550-6be7678c45d2 github.com/blang/semver/v4 v4.0.0 github.com/cheekybits/genny v1.0.0 - github.com/fatih/color v1.16.0 + github.com/fatih/color v1.17.0 github.com/goss-org/GOnetstat v0.0.0-20230101144325-22be0bd9e64d github.com/goss-org/go-ps v0.0.0-20230609005227-7b318e6a56e5 github.com/hashicorp/logutils v1.0.0 - github.com/miekg/dns v1.1.58 + github.com/miekg/dns v1.1.61 github.com/moby/sys/mountinfo v0.7.1 github.com/oleiade/reflections v1.0.1 github.com/onsi/gomega v1.33.1 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pmezard/go-difflib v1.0.0 - github.com/prometheus/client_golang v1.19.0 - github.com/prometheus/common v0.50.0 - github.com/samber/lo v1.39.0 + github.com/prometheus/client_golang v1.19.1 + github.com/prometheus/common v0.55.0 + github.com/samber/lo v1.46.0 github.com/stretchr/testify v1.9.0 github.com/tidwall/gjson v1.17.1 github.com/urfave/cli v1.22.14 @@ -31,31 +31,32 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/huandu/xstrings v1.4.0 // indirect + github.com/huandu/xstrings v1.5.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/shopspring/decimal v1.3.1 // indirect + github.com/shopspring/decimal v1.4.0 // indirect github.com/spf13/cast v1.6.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect - golang.org/x/crypto v0.23.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/crypto v0.25.0 // indirect + golang.org/x/exp v0.0.0-20240716160929-1d5bc16f04a8 // indirect + golang.org/x/mod v0.19.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - golang.org/x/tools v0.20.0 // indirect - google.golang.org/protobuf v1.33.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/tools v0.23.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect ) diff --git a/go.sum b/go.sum index 6f024b4c..ace20f75 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -24,6 +26,8 @@ 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.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= @@ -46,6 +50,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= +github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= @@ -60,6 +66,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= +github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= +github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -68,6 +76,8 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g= github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/oleiade/reflections v1.0.1 h1:D1XO3LVEYroYskEsoSiGItp9RUxG6jWnCVvrqH0HHQM= github.com/oleiade/reflections v1.0.1/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= @@ -80,21 +90,33 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA= github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= +github.com/samber/lo v1.46.0 h1:w8G+oaCPgz1PoCJztqymCFaKwXt+5cCXn51uPxExFfQ= +github.com/samber/lo v1.46.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= @@ -124,17 +146,25 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240716160929-1d5bc16f04a8 h1:Z+vTUQyBb738QmIhbJx3z4htsxDeI+rd0EHvNm8jHkg= +golang.org/x/exp v0.0.0-20240716160929-1d5bc16f04a8/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= @@ -149,6 +179,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -158,14 +190,20 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= From 6ef233dca2b9b2cf8805a3d8885589528dddb6ba Mon Sep 17 00:00:00 2001 From: Ahmed Elsabbahy Date: Thu, 18 Jul 2024 12:08:10 -0700 Subject: [PATCH 02/12] Fixed: the user-agent test on release builds (#955) The user-agent test assumed goss will always have v0.0.0, this is not the case in a release build. --- integration-tests/goss/goss-shared.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/goss/goss-shared.yaml b/integration-tests/goss/goss-shared.yaml index 220ec4e8..b3dc4a01 100644 --- a/integration-tests/goss/goss-shared.yaml +++ b/integration-tests/goss/goss-shared.yaml @@ -206,7 +206,7 @@ http: headers: ["Content-Type: application/json"] body: - '"Foo": "bar"' - - '"User-Agent": "goss/0.0.0"' + - '/"User-Agent": "goss/[0-9]+.[0-9]+.[0-9]+"/' http://httpbin/headers?host: status: 200 timeout: 60000 From aed56336c3e8ff683e9540065b502f423dd6760d Mon Sep 17 00:00:00 2001 From: Ahmed Elsabbahy Date: Fri, 19 Jul 2024 08:19:56 -0700 Subject: [PATCH 03/12] Fix test file for release (#956) --- integration-tests/goss/goss-shared.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/goss/goss-shared.yaml b/integration-tests/goss/goss-shared.yaml index b3dc4a01..42e8a5e7 100644 --- a/integration-tests/goss/goss-shared.yaml +++ b/integration-tests/goss/goss-shared.yaml @@ -206,7 +206,7 @@ http: headers: ["Content-Type: application/json"] body: - '"Foo": "bar"' - - '/"User-Agent": "goss/[0-9]+.[0-9]+.[0-9]+"/' + - '/"User-Agent": "goss/v?[0-9]+.[0-9]+.[0-9]+"/' http://httpbin/headers?host: status: 200 timeout: 60000 From 5cb881b8513f9c452b2ba0735b1e397398721629 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:07:39 +0200 Subject: [PATCH 04/12] ci: add integration tests for windows and macOS (#950) --- .github/workflows/golangci.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/golangci.yaml b/.github/workflows/golangci.yaml index c04a58a9..b6ddfd13 100644 --- a/.github/workflows/golangci.yaml +++ b/.github/workflows/golangci.yaml @@ -41,10 +41,14 @@ jobs: - name: Unit tests and coverage run: make cov - integartion-test: + integration-test: needs: [coverage] name: Integration tests - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 @@ -52,4 +56,12 @@ jobs: go-version-file: go.mod - name: Integration tests - run: make test-int-all + shell: bash + run: | + os_name="$(go env GOOS)" + if [[ "${os_name}" == "darwin" || "${os_name}" == "windows" ]]; then + make "test-int-${os_name}-all" + else + # linux runs all tests; + make test-int-all + fi From 1215fceea6c4dd426cdb612777c3567033446788 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Thu, 1 Aug 2024 22:08:39 +0200 Subject: [PATCH 05/12] fix(ci): rework get latest tag for build Docker image (#954) * fix getting tag when building container * add debug informations * fix debug output --- .github/workflows/docker-goss.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-goss.yaml b/.github/workflows/docker-goss.yaml index 78e07bdc..5516a611 100644 --- a/.github/workflows/docker-goss.yaml +++ b/.github/workflows/docker-goss.yaml @@ -45,13 +45,25 @@ jobs: ghcr.io/${{ github.repository_owner }}/goss - name: Get latest git tag - uses: actions-ecosystem/action-get-latest-tag@v1 + if: github.ref_name == 'master' id: get-latest-tag + run: | + # source: https://github.com/actions-ecosystem/action-get-latest-tag/blob/main/entrypoint.sh + set -e + git config --global --add safe.directory /github/workspace + git fetch --tags --force + # This suppress an error occurred when the repository is a complete one. + git fetch --prune --unshallow 2>/dev/null || true + latest_tag=$(git describe --abbrev=0 --tags || true) + echo "tag=${latest_tag}" >> "$GITHUB_OUTPUT" + echo "Latest tag: $latest_tag" - name: Set short git commit SHA + if: github.ref_name == 'master' run: | calculatedSha=$(git rev-parse --short ${{ github.sha }}) echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV + echo "COMMIT_SHORT_SHA: $calculatedSha" - name: Get the current version of Go from project. run: echo "GO_VERSION_FROM_PROJECT=$(go mod edit -json | jq -r .Go)" >> $GITHUB_ENV From 61f7ff9927ab0a46b84239b117bf3fe3cfc89549 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Sat, 10 Aug 2024 22:55:17 +0200 Subject: [PATCH 06/12] docs: fix links to documentation (https://goss.readthedocs.io) and bump version examples (#958) * docs: bump version in setup example * docs: bump version in setup examples * docs: fix links to documentation --- README.md | 12 ++++++------ extras/dgoss/README.md | 4 ++-- extras/kgoss/README.md | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cc5d4043..fe18d0fc 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,8 @@ This will install goss and [dgoss](https://github.com/goss-org/goss/tree/master/ # Install latest version to /usr/local/bin curl -fsSL https://goss.rocks/install | sh -# Install v0.3.16 version to ~/bin -curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.16 GOSS_DST=~/bin sh +# Install v0.4.8 version to ~/bin +curl -fsSL https://goss.rocks/install | GOSS_VER=v0.4.8 GOSS_DST=~/bin sh ``` @@ -73,12 +73,12 @@ chmod +rx /usr/local/bin/dgoss ```bash # See https://github.com/goss-org/goss/releases for release versions -VERSION=v0.3.10 +VERSION=v0.4.8 curl -L "https://github.com/goss-org/goss/releases/download/${VERSION}/goss-linux-amd64" -o /usr/local/bin/goss chmod +rx /usr/local/bin/goss # (optional) dgoss docker wrapper (use 'master' for latest version) -VERSION=v0.3.10 +VERSION=v0.4.8 curl -L "https://github.com/goss-org/goss/releases/download/${VERSION}/dgoss" -o /usr/local/bin/dgoss chmod +rx /usr/local/bin/dgoss ``` @@ -93,11 +93,11 @@ make build ## Full Documentation -[Full Documentation](https://github.com/goss-org/goss/blob/e73553f9c3065ac297499dafb4f8abef6acb24ad/docs/manual.md) +[Full Documentation](https://goss.readthedocs.io/en/stable/) ## Using the container image -[Using the Goss container image](docs/container_image.md) +[Using the Goss container image](https://goss.readthedocs.io/en/stable/container_image/) ## Quick start diff --git a/extras/dgoss/README.md b/extras/dgoss/README.md index ebe7fd3f..8dd1d827 100644 --- a/extras/dgoss/README.md +++ b/extras/dgoss/README.md @@ -25,8 +25,8 @@ Since goss runs on the target container, dgoss can be used on a Mac OSX system b curl -L https://raw.githubusercontent.com/goss-org/goss/master/extras/dgoss/dgoss -o /usr/local/bin/dgoss chmod +rx /usr/local/bin/dgoss -# Download desired goss version to your preferred location (e.g. v0.3.6) -curl -L https://github.com/goss-org/goss/releases/download/v0.3.6/goss-linux-amd64 -o ~/Downloads/goss-linux-amd64 +# Download desired goss version to your preferred location (e.g. v0.4.8) +curl -L https://github.com/goss-org/goss/releases/download/v0.4.8/goss-linux-amd64 -o ~/Downloads/goss-linux-amd64 # Set your GOSS_PATH to the above location export GOSS_PATH=~/Downloads/goss-linux-amd64 diff --git a/extras/kgoss/README.md b/extras/kgoss/README.md index eb9f14d4..09e8f776 100644 --- a/extras/kgoss/README.md +++ b/extras/kgoss/README.md @@ -59,7 +59,7 @@ chmod a+rx "${dest_dir}/kgoss" ## install goss if [[ ! $(which jq) ]]; then echo "jq is required, get from https://stedolan.github.io/jq"; fi -version=v0.3.8 +version=v0.4.8 arch=amd64 host=github.com # for private repos, leave `host` blank or same as above: From 5cdd0f953dcd36c6499c83c5aaf50ca0c320511c Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Sat, 10 Aug 2024 22:58:09 +0200 Subject: [PATCH 07/12] ci: bump httpd in rockylinux9 (#961) --- integration-tests/goss/rockylinux9/goss-aa-expected.yaml | 2 +- integration-tests/goss/rockylinux9/goss-expected.yaml | 2 +- integration-tests/goss/vars.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integration-tests/goss/rockylinux9/goss-aa-expected.yaml b/integration-tests/goss/rockylinux9/goss-aa-expected.yaml index 7fd1552f..38c05599 100644 --- a/integration-tests/goss/rockylinux9/goss-aa-expected.yaml +++ b/integration-tests/goss/rockylinux9/goss-aa-expected.yaml @@ -2,7 +2,7 @@ package: httpd: installed: true versions: - - 2.4.57-8.el9 + - 2.4.57-11.el9_4 port: tcp:80: listening: true diff --git a/integration-tests/goss/rockylinux9/goss-expected.yaml b/integration-tests/goss/rockylinux9/goss-expected.yaml index bbd4249e..9a1bacb1 100644 --- a/integration-tests/goss/rockylinux9/goss-expected.yaml +++ b/integration-tests/goss/rockylinux9/goss-expected.yaml @@ -15,7 +15,7 @@ package: httpd: installed: true versions: - - 2.4.57-8.el9 + - 2.4.57-11.el9_4 vim-tiny: installed: false addr: diff --git a/integration-tests/goss/vars.yaml b/integration-tests/goss/vars.yaml index 0cc72dba..23b0c3b0 100644 --- a/integration-tests/goss/vars.yaml +++ b/integration-tests/goss/vars.yaml @@ -16,7 +16,7 @@ centos7: rockylinux9: proxy: http://127.0.0.1:8888 packages: - httpd: "2.4.57-8.el9" + httpd: "2.4.57-11.el9_4" services: httpd: [] trusty: From 191fe3229e1de36ca8f72f5b96fb9c0809790c43 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Thu, 15 Aug 2024 22:16:34 +0200 Subject: [PATCH 08/12] Build own docker images for integration tests (#901) * Build own docker images and upload to ghcr * update md5 sum for dockerfiles * minor text updates * Remove outdated lines from Dockerfile_arch * generate the list of dockerfiles dynamically * update wheezy checksum * fix line endings * disable automatic builds * bump httpd version for rockylinux --- .../workflows/docker-integration-tests.yaml | 80 +++++++++++++++++++ integration-tests/Dockerfile_arch | 3 +- integration-tests/Dockerfile_arch.md5 | 2 +- integration-tests/Dockerfile_wheezy | 4 +- integration-tests/Dockerfile_wheezy.md5 | 2 +- .../goss/rockylinux9/goss-aa-expected.yaml | 2 +- .../goss/rockylinux9/goss-expected.yaml | 2 +- integration-tests/goss/vars.yaml | 2 +- 8 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/docker-integration-tests.yaml diff --git a/.github/workflows/docker-integration-tests.yaml b/.github/workflows/docker-integration-tests.yaml new file mode 100644 index 00000000..e091866d --- /dev/null +++ b/.github/workflows/docker-integration-tests.yaml @@ -0,0 +1,80 @@ +name: Docker images for integration tests + +on: +# push: +# branches: +# - master + workflow_dispatch: + +env: + PLATFORMS: "linux/amd64" + +jobs: + list-dockerfiles: + name: Create list of existing dockerfiles + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Get file list + id: set-matrix + run: | + # lists all Dockerfile_* and ignore (grep) files with extension (e.g. *.md5) + # tranforms the file list in JSON array (StackOverflow#10234327) + # converts the list into objects of dockerfile and image name + ls integration-tests/Dockerfile_* | + grep -Ev "\..{0,3}$" | + jq -R -s 'split("\n")[:-1]' | + jq '. | map({dockerfile: ., image: sub(".*_"; "")})' > filelist.json + echo "matrix=$(jq -c . filelist.json)" >> "$GITHUB_OUTPUT" + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + + docker: + needs: [list-dockerfiles] + name: Build and push Docker image + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.list-dockerfiles.outputs.matrix) }} + permissions: + packages: write + contents: read + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository_owner }}/${{ matrix.image }} + + - name: Build and push tag + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ matrix.dockerfile }} + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:latest + labels: ${{ steps.meta.outputs.labels }} + platforms: ${{ env.PLATFORMS }} diff --git a/integration-tests/Dockerfile_arch b/integration-tests/Dockerfile_arch index 67833345..0f0627cd 100644 --- a/integration-tests/Dockerfile_arch +++ b/integration-tests/Dockerfile_arch @@ -1,7 +1,6 @@ -FROM base/archlinux +FROM archlinux:base MAINTAINER @siddharthist -RUN pacman -Sy --noconfirm systemd-sysvcompat RUN ln -s /does_not_exist /foo && \ chmod 700 ~root RUN mkfifo /pipe diff --git a/integration-tests/Dockerfile_arch.md5 b/integration-tests/Dockerfile_arch.md5 index 368bc9e8..aa80cc1d 100644 --- a/integration-tests/Dockerfile_arch.md5 +++ b/integration-tests/Dockerfile_arch.md5 @@ -1 +1 @@ -7743af2cd089e92858eca1715db25949 Dockerfile_arch +8fc3ce0c000f89ab09488cccb3ba8e66 Dockerfile_arch diff --git a/integration-tests/Dockerfile_wheezy b/integration-tests/Dockerfile_wheezy index 9c83d08c..f3c76e36 100644 --- a/integration-tests/Dockerfile_wheezy +++ b/integration-tests/Dockerfile_wheezy @@ -4,7 +4,9 @@ LABEL org.opencontainers.image.authors="Ahmed" RUN echo 'deb http://archive.debian.org/debian wheezy main' > /etc/apt/sources.list RUN echo 'deb http://archive.debian.org/debian-security wheezy/updates main' >> /etc/apt/sources.list -RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y apache2 apache2-doc apache2-utils chkconfig vim-tiny ca-certificates tinyproxy && apt-get remove -y vim-tiny && apt-get clean +RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install --yes --force-yes \ + apache2 apache2-doc apache2-utils chkconfig vim-tiny ca-certificates tinyproxy && \ + apt-get remove -y vim-tiny && apt-get clean RUN chkconfig apache2 on RUN chkconfig tinyproxy on diff --git a/integration-tests/Dockerfile_wheezy.md5 b/integration-tests/Dockerfile_wheezy.md5 index 84e9e5dd..fd678787 100644 --- a/integration-tests/Dockerfile_wheezy.md5 +++ b/integration-tests/Dockerfile_wheezy.md5 @@ -1 +1 @@ -557a19e04e66f0a9afb6035952b5ca18 Dockerfile_wheezy +3775dbcd23497095da8f5b7ddb62a540 Dockerfile_wheezy diff --git a/integration-tests/goss/rockylinux9/goss-aa-expected.yaml b/integration-tests/goss/rockylinux9/goss-aa-expected.yaml index 38c05599..a5e1aa63 100644 --- a/integration-tests/goss/rockylinux9/goss-aa-expected.yaml +++ b/integration-tests/goss/rockylinux9/goss-aa-expected.yaml @@ -2,7 +2,7 @@ package: httpd: installed: true versions: - - 2.4.57-11.el9_4 + - 2.4.57-11.el9_4.1 port: tcp:80: listening: true diff --git a/integration-tests/goss/rockylinux9/goss-expected.yaml b/integration-tests/goss/rockylinux9/goss-expected.yaml index 9a1bacb1..0e950c20 100644 --- a/integration-tests/goss/rockylinux9/goss-expected.yaml +++ b/integration-tests/goss/rockylinux9/goss-expected.yaml @@ -15,7 +15,7 @@ package: httpd: installed: true versions: - - 2.4.57-11.el9_4 + - 2.4.57-11.el9_4.1 vim-tiny: installed: false addr: diff --git a/integration-tests/goss/vars.yaml b/integration-tests/goss/vars.yaml index 23b0c3b0..0686fd1a 100644 --- a/integration-tests/goss/vars.yaml +++ b/integration-tests/goss/vars.yaml @@ -16,7 +16,7 @@ centos7: rockylinux9: proxy: http://127.0.0.1:8888 packages: - httpd: "2.4.57-11.el9_4" + httpd: "2.4.57-11.el9_4.1" services: httpd: [] trusty: From 2d8846d3e62db048df6aafb6ea91454ae67a3515 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Fri, 16 Aug 2024 01:53:02 +0200 Subject: [PATCH 09/12] add md5 checksum of dockerfiles to image labels (#967) --- .github/workflows/docker-integration-tests.yaml | 7 +++++++ development/build_images.sh | 2 ++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/docker-integration-tests.yaml b/.github/workflows/docker-integration-tests.yaml index e091866d..74986a9e 100644 --- a/.github/workflows/docker-integration-tests.yaml +++ b/.github/workflows/docker-integration-tests.yaml @@ -61,12 +61,19 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: MD5 of Dockerfile + id: md5_result + run: | + echo "md5=$(md5sum "${{ matrix.dockerfile }}" | awk '{ print $1 }')" >> $GITHUB_OUTPUT + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 with: images: | ghcr.io/${{ github.repository_owner }}/${{ matrix.image }} + labels: | + rocks.goss.dockerfile-md5=${{ steps.md5_result.outputs.md5 }} - name: Build and push tag uses: docker/build-push-action@v5 diff --git a/development/build_images.sh b/development/build_images.sh index 9238294b..fe1fd2b9 100755 --- a/development/build_images.sh +++ b/development/build_images.sh @@ -12,6 +12,7 @@ LABEL_REVISION=$(git rev-parse HEAD) for docker_file in $INTEGRATION_TEST_DIR/Dockerfile_*; do [[ $docker_file == *.md5 ]] && continue os=$(cut -d '_' -f2 <<<"$docker_file") + md5=$(md5sum "$docker_file" | awk '{ print $1 }') docker build \ --label "org.opencontainers.image.created=$LABEL_DATE" \ --label "org.opencontainers.image.description=Quick and Easy server testing/validation" \ @@ -21,5 +22,6 @@ for docker_file in $INTEGRATION_TEST_DIR/Dockerfile_*; do --label "org.opencontainers.image.title=goss" \ --label "org.opencontainers.image.url=$LABEL_URL" \ --label "org.opencontainers.image.version=manual" \ + --label "rocks.goss.dockerfile-md5"=$md5 \ -t "aelsabbahy/goss_${os}:latest" - < "$docker_file" done From 9d9b95f1eeef8c0a550c151ad92f8a72226bc725 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:48:32 +0200 Subject: [PATCH 10/12] fix: convert line endings of Dockerfile to linux (#952) * fix: convert line endings of Dockerfile to linux * bump httpd version --------- Co-authored-by: Ahmed Elsabbahy --- Dockerfile | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 73e4f50d..2849a2b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,19 @@ -ARG GO_VERSION=1.22 - -FROM docker.io/golang:${GO_VERSION}-alpine AS base - -ARG GOSS_VERSION=v0.0.0 -WORKDIR /build - -RUN --mount=target=. \ - CGO_ENABLED=0 go build \ - -ldflags "-X github.com/goss-org/goss/util.Version=${GOSS_VERSION} -s -w" \ - -o "/release/goss" \ - ./cmd/goss - -FROM alpine:3.19 - -COPY --from=base /release/* /usr/bin/ - -RUN mkdir /goss -VOLUME /goss +ARG GO_VERSION=1.22 + +FROM docker.io/golang:${GO_VERSION}-alpine AS base + +ARG GOSS_VERSION=v0.0.0 +WORKDIR /build + +RUN --mount=target=. \ + CGO_ENABLED=0 go build \ + -ldflags "-X github.com/goss-org/goss/util.Version=${GOSS_VERSION} -s -w" \ + -o "/release/goss" \ + ./cmd/goss + +FROM alpine:3.19 + +COPY --from=base /release/* /usr/bin/ + +RUN mkdir /goss +VOLUME /goss From b2bf15a4eefa5826263c929ab33af1ec910246ac Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Thu, 29 Aug 2024 20:50:30 +0200 Subject: [PATCH 11/12] use variables to set container registry and repository in scripts (#968) * use variables to set container registry and repository in scripts * remove "docker.io" * fix tests.sh --- development/build_images.sh | 3 ++- development/push_images.sh | 3 ++- integration-tests/test.sh | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/development/build_images.sh b/development/build_images.sh index fe1fd2b9..fcfc1da9 100755 --- a/development/build_images.sh +++ b/development/build_images.sh @@ -4,6 +4,7 @@ set -xeu SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" INTEGRATION_TEST_DIR="$SCRIPT_DIR/../integration-tests/" +CONTAINER_REPOSITORY="aelsabbahy" LABEL_DATE=$(date -u +'%Y-%m-%dT%H:%M:%S.%3NZ') LABEL_URL="https://github.com/goss-org/goss" @@ -23,5 +24,5 @@ for docker_file in $INTEGRATION_TEST_DIR/Dockerfile_*; do --label "org.opencontainers.image.url=$LABEL_URL" \ --label "org.opencontainers.image.version=manual" \ --label "rocks.goss.dockerfile-md5"=$md5 \ - -t "aelsabbahy/goss_${os}:latest" - < "$docker_file" + -t "$CONTAINER_REPOSITORY/goss_${os}:latest" - < "$docker_file" done diff --git a/development/push_images.sh b/development/push_images.sh index fcbc4557..680f9605 100755 --- a/development/push_images.sh +++ b/development/push_images.sh @@ -3,7 +3,8 @@ set -xeu SCRIPT_DIR=$(readlink -f "$(dirname "$0")") -images=$(docker images | grep '^aelsabbahy/goss_.*latest' | awk '$0=$1') +CONTAINER_REPOSITORY="aelsabbahy" +images=$(docker images | grep "^$CONTAINER_REPOSITORY/goss_.*latest" | awk '$0=$1') # Use md5sum to determine if CI needs to do a docker build pushd "$SCRIPT_DIR/../integration-tests"; diff --git a/integration-tests/test.sh b/integration-tests/test.sh index 2b9936d1..e92d08b0 100755 --- a/integration-tests/test.sh +++ b/integration-tests/test.sh @@ -8,6 +8,7 @@ os="${1:?"Need OS as 1st arg. e.g. alpine arch centos7 rockylinux9 trusty wheezy arch="${2:?"Need arch as 2nd arg. e.g. amd64 386"}" vars_inline="{inline: bar, overwrite: bar}" +container_repository="aelsabbahy" # setup places us inside repo-root; this preserves current behaviour with least change. cd integration-tests @@ -15,10 +16,10 @@ cd integration-tests cp "../release/goss-linux-$arch" "goss/$os/" # Run build if Dockerfile has changed but hasn't been pushed to dockerhub if ! md5sum -c "Dockerfile_${os}.md5"; then - docker build -t "aelsabbahy/goss_${os}:latest" - < "Dockerfile_$os" + docker build -t "$container_repository/goss_${os}:latest" - < "Dockerfile_$os" # Pull if image doesn't exist locally -elif ! docker images | grep "aelsabbahy/goss_$os";then - docker pull "aelsabbahy/goss_$os" +elif ! docker images | grep "$container_repository/goss_$os";then + docker pull "$container_repository/goss_$os" fi container_name="goss_int_test_${os}_${arch}" @@ -37,7 +38,7 @@ network=goss-test docker network create --driver bridge --subnet '172.19.0.0/16' $network docker run -d --name httpbin --network $network kennethreitz/httpbin opts=(--env OS=$os --cap-add SYS_ADMIN -v "$PWD/goss:/goss" -d --name "$container_name" --security-opt seccomp:unconfined --security-opt label:disable --privileged) -id=$(docker run "${opts[@]}" --network $network "aelsabbahy/goss_$os" /sbin/init) +id=$(docker run "${opts[@]}" --network $network "$container_repository/goss_$os" /sbin/init) ip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$id") trap "rv=\$?; docker rm -vf $id;docker rm -vf httpbin;docker network rm $network; exit \$rv" INT TERM EXIT # Give httpd time to start up, adding 1 second to see if it helps with intermittent CI failures From 02d6c53a32b92d52023e31fc305322e220b97070 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 11:54:44 -0700 Subject: [PATCH 12/12] Bump docker/build-push-action from 5 to 6 (#943) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v5...v6) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker-goss.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-goss.yaml b/.github/workflows/docker-goss.yaml index 5516a611..8784fc56 100644 --- a/.github/workflows/docker-goss.yaml +++ b/.github/workflows/docker-goss.yaml @@ -70,7 +70,7 @@ jobs: - name: Build master goss image if: github.ref_name == 'master' - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: build-args: | GO_VERSION=${{ env.GO_VERSION_FROM_PROJECT }} @@ -84,7 +84,7 @@ jobs: - name: Build release goss image if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: build-args: | GO_VERSION=${{ env.GO_VERSION_FROM_PROJECT }}