diff --git a/cmd/agent/common/misconfig/mounts.go b/cmd/agent/common/misconfig/mounts.go index f9645134..c4ef071a 100644 --- a/cmd/agent/common/misconfig/mounts.go +++ b/cmd/agent/common/misconfig/mounts.go @@ -3,6 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. +//go:build linux // +build linux package misconfig @@ -15,9 +16,9 @@ import ( "strconv" "strings" + "github.com/n9e/n9e-agentd/pkg/config" "github.com/pkg/errors" "github.com/syndtr/gocapability/capability" - "github.com/n9e/n9e-agentd/pkg/config" "k8s.io/klog/v2" ) @@ -56,7 +57,7 @@ func procMount() error { if !haveEgid { groups = append(groups, egid) } - path := config.C.ContainerProcRoot + path := config.C.Container.ProcRoot if config.IsContainerized() && path != "/proc" { path = filepath.Join(path, "1/mounts") } else { diff --git a/go.mod b/go.mod index 8a8b85e6..18b3645e 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/util/log => ./staging/datadog-agent/pkg/util/log github.com/DataDog/datadog-agent/pkg/util/winutil => ./staging/datadog-agent/pkg/util/winutil github.com/DataDog/mmh3 => github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a + github.com/n9e/n9e-agentd => ../n9e-agentd github.com/yubo/apiserver => ../apiserver github.com/yubo/golib => ../golib ) @@ -17,6 +18,7 @@ replace ( // Internal deps fix version replace ( + code.cloudfoundry.org/consuladapter => code.cloudfoundry.org/consuladapter v0.0.0-20200131002136-ac1daf48ba97 github.com/cihub/seelog => github.com/cihub/seelog v0.0.0-20151216151435-d2c6e5aa9fbf // v2.6 github.com/coreos/go-systemd => github.com/coreos/go-systemd v0.0.0-20180202092358-40e2722dffea github.com/docker/distribution => github.com/docker/distribution v2.7.1-0.20190104202606-0ac367fd6bee+incompatible @@ -36,6 +38,7 @@ replace ( ) require ( + code.cloudfoundry.org/executor v0.1441.2 // indirect github.com/DataDog/datadog-agent v0.0.0-20210730134932-2365d4a4f838 github.com/DataDog/datadog-agent/pkg/util/log v0.30.0-rc.7 github.com/DataDog/datadog-agent/pkg/util/winutil v0.30.0-rc.7 @@ -44,7 +47,6 @@ require ( github.com/DataDog/gopsutil v0.0.0-20200624212600-1b53412ef321 github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 - github.com/coreos/etcd v3.3.25+incompatible // indirect github.com/coreos/go-semver v0.3.0 github.com/emicklei/go-restful v2.15.0+incompatible github.com/fatih/color v1.12.0 @@ -56,6 +58,7 @@ require ( github.com/gosnmp/gosnmp v1.32.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 + github.com/ianlancetaylor/cgosymbolizer v0.0.0-20210303021718-7cb7081f6b86 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 github.com/n9e/agent-payload v0.0.0-20210803052830-38cc6d91cc21 github.com/olekukonko/tablewriter v0.0.5 @@ -71,12 +74,12 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.7.0 github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 - github.com/yubo/apiserver v0.0.0-20210827105854-e08676c3df33 - github.com/yubo/golib v0.0.0-20210818091248-62b6daa0f29d - go.etcd.io/etcd v3.3.25+incompatible // indirect + github.com/tklauser/go-sysconf v0.3.9 // indirect + github.com/yubo/apiserver v0.0.0-20210918082128-653f7fb53aa9 + github.com/yubo/golib v0.0.0-20210922085935-91c4ef1612a4 go.uber.org/automaxprocs v1.4.0 golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f - golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 + golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71 golang.org/x/text v0.3.6 google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c google.golang.org/grpc v1.38.0 diff --git a/go.sum b/go.sum index d15411ef..fdc93f9b 100644 --- a/go.sum +++ b/go.sum @@ -47,28 +47,28 @@ code.cloudfoundry.org/clock v1.0.0 h1:kFXWQM4bxYvdBw2X8BbBeXwQNgfoWv1vqAk2ZZyBN2 code.cloudfoundry.org/clock v1.0.0/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8= code.cloudfoundry.org/consuladapter v0.0.0-20200131002136-ac1daf48ba97 h1:ESnk2S/BMpu3ndjQRSMvwKFFkF25GTQvGRSSHQy0Wdw= code.cloudfoundry.org/consuladapter v0.0.0-20200131002136-ac1daf48ba97/go.mod h1:bOVcKUGVpa9/23DMPJUd4mPt420blgr/Tpwb0+y32Cc= -code.cloudfoundry.org/diego-logging-client v0.0.0-20200130234554-60ef08820a45 h1:WtR6lLAuZsSekDsCsup0UlzWeZLQ2k3QHaUvd7Zn3Io= -code.cloudfoundry.org/diego-logging-client v0.0.0-20200130234554-60ef08820a45/go.mod h1:L8Y+60YwdebCsAE6US++EVqddijkVMMC4Ucx0nPH03o= -code.cloudfoundry.org/executor v0.0.0-20200218194701-024d0bdd52d4 h1:7Xt9CK85rIiYmkC0mnP1rmD3JWExDFRiVYjLED+NBPw= -code.cloudfoundry.org/executor v0.0.0-20200218194701-024d0bdd52d4/go.mod h1:oemBimQzPedAfYleiBj968jpfEkSw8F5OsP+zYkVMRk= +code.cloudfoundry.org/diego-logging-client v0.0.0-20210622170659-8861ae5ba2ed h1:Qh2HydgreIaleNEELfIfFdwZm0g6S21Qbciz8Y1A+WA= +code.cloudfoundry.org/diego-logging-client v0.0.0-20210622170659-8861ae5ba2ed/go.mod h1:x///zILDLKzCz2SauYWxzoiEumjnvpDEZg0FZFYIj1g= +code.cloudfoundry.org/executor v0.1441.2 h1:gJFyhkhrcM+BC3NRe835HkEJ3mUncw+2zvVjDnGHFeU= +code.cloudfoundry.org/executor v0.1441.2/go.mod h1:oemBimQzPedAfYleiBj968jpfEkSw8F5OsP+zYkVMRk= code.cloudfoundry.org/garden v0.0.0-20210208153517-580cadd489d2 h1:yuiaehHdBGsP2YVma86r25a9ycRw0Pbmy2GjZ5Dk35w= code.cloudfoundry.org/garden v0.0.0-20210208153517-580cadd489d2/go.mod h1:Z9w+yiu8NUNM7ZXBsveh4wcsjZdkICVuNZkF1CqLi2E= +code.cloudfoundry.org/go-diodes v0.0.0-20180905200951-72629b5276e3/go.mod h1:Jzi+ccHgo/V/PLQUaQ6hnZcC1c4BS790gx21LRRui4g= code.cloudfoundry.org/go-diodes v0.0.0-20190809170250-f77fb823c7ee h1:iAAPf9s7/+BIiGf+RjgcXLm3NoZaLIJsBXJuUa63Lx8= code.cloudfoundry.org/go-diodes v0.0.0-20190809170250-f77fb823c7ee/go.mod h1:Jzi+ccHgo/V/PLQUaQ6hnZcC1c4BS790gx21LRRui4g= -code.cloudfoundry.org/go-loggregator v7.4.0+incompatible h1:KqZYloMQWM5Zg/BQKunOIA4OODh7djZbk48qqbowNFI= -code.cloudfoundry.org/go-loggregator v7.4.0+incompatible/go.mod h1:KPBTRqj+y738Nhf1+g4JHFaBU8j7dedirR5ETNHvMXU= +code.cloudfoundry.org/go-loggregator/v8 v8.0.5 h1:p1rrGxTwUqLjlUVtbjTAvKOSGNmPuBja8LeQOQgRrBc= +code.cloudfoundry.org/go-loggregator/v8 v8.0.5/go.mod h1:mLlJ1ZyG6gVvBEtYypvbztRvFeCtBsTxE9tt+85tS6Y= code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f h1:UrKzEwTgeiff9vxdrfdqxibzpWjxLnuXDI5m6z3GJAk= code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f/go.mod h1:sk5LnIjB/nIEU7yP5sDQExVm62wu0pBh3yrElngUisI= code.cloudfoundry.org/lager v2.0.0+incompatible h1:WZwDKDB2PLd/oL+USK4b4aEjUymIej9My2nUQ9oWEwQ= code.cloudfoundry.org/lager v2.0.0+incompatible/go.mod h1:O2sS7gKP3HM2iemG+EnwvyNQK7pTSC6Foi4QiMp9sSk= -code.cloudfoundry.org/locket v0.0.0-20200131001124-67fd0a0fdf2d h1:4a9j7UW7yfC57sgUI0ZIJRZDl4Jzopm1LjEa/r5v36I= -code.cloudfoundry.org/locket v0.0.0-20200131001124-67fd0a0fdf2d/go.mod h1:AwHLRkdXtttLXNB8RHgLfErJ2kKafH62AR2OClhy6xI= +code.cloudfoundry.org/locket v0.0.0-20210706150026-b8ae29a4de0f h1:ml2FnGX8fNx2MYNoYFycbKjSrp1Cd51tH6BXD/Mubkw= +code.cloudfoundry.org/locket v0.0.0-20210706150026-b8ae29a4de0f/go.mod h1:AwHLRkdXtttLXNB8RHgLfErJ2kKafH62AR2OClhy6xI= code.cloudfoundry.org/rep v0.0.0-20200325195957-1404b978e31e h1:vOdVK7gb0N0XyhLaZNqY+Zcia577jhNBpxzbxFqYof0= code.cloudfoundry.org/rep v0.0.0-20200325195957-1404b978e31e/go.mod h1:Z5Ez6B/8Ec6h2ybwrzEfHOZSSPvlIGO3TmL4mMzOwFg= -code.cloudfoundry.org/rfc5424 v0.0.0-20180905210152-236a6d29298a h1:8rqv2w8xEceNwckcF5ONeRt0qBHlh5bnNfFnYTrZbxs= -code.cloudfoundry.org/rfc5424 v0.0.0-20180905210152-236a6d29298a/go.mod h1:tkZo8GtzBjySJ7USvxm4E36lNQw1D3xM6oKHGqdaAJ4= -code.cloudfoundry.org/tlsconfig v0.0.0-20200131000646-bbe0f8da39b3 h1:2Qal+q+tw/DmDOoJBWwDCPE3lIJNj/1o7oMkkb2c5SI= code.cloudfoundry.org/tlsconfig v0.0.0-20200131000646-bbe0f8da39b3/go.mod h1:eTbFJpyXRGuFVyg5+oaj9B2eIbIc+0/kZjH8ftbtdew= +code.cloudfoundry.org/tlsconfig v0.0.0-20210615191307-5d92ef3894a7 h1:5N6M1WbWH3bknkX80Q/s7eEo5odqjixLAW79Zrrbqu0= +code.cloudfoundry.org/tlsconfig v0.0.0-20210615191307-5d92ef3894a7/go.mod h1:CKI5CV+3MlfcohVSuU3FxXubFyC52lYJGMLnZ2ltvks= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AlekSi/pointer v1.0.0/go.mod h1:1kjywbfcPFCmncIxtk6fIEub6LKrfMz3gc5QKVOSOA8= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= @@ -134,7 +134,6 @@ github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab/go.mod h1:3VYc5 github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd h1:sjQovDkwrZp8u+gxLtPgKGjk5hCxuy2hrRejBTA9xFU= github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= -github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= @@ -173,9 +172,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdko github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20170221213301-9f32b5905fd6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 h1:UUppSQnhf4Yc6xGxSkoQpPhb7RVzuv5Nb1mwJ5VId9s= github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 h1:5sXbqlSomvdjlRbWyNqkPsJ3Fg+tQZCbgeX1VGljbQY= -github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM= github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= @@ -197,13 +195,13 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.1 h1:KqhlKozYbRtJvsPrrEeXcO+N2l6NYT5A2QAFmSULpEc= -github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apoydence/eachers v0.0.0-20181020210610-23942921fe77/go.mod h1:bXvGk6IkT1Agy7qzJ+DjIw/SJ1AaB3AvAuMDVV+Vkoo= github.com/arduino/go-apt-client v0.0.0-20190812130613-5613f843fdc8 h1:HpmeqWCUoU+dPrz8V4KGDMDxvR+WyeJ0g6DSSqnptuY= github.com/arduino/go-apt-client v0.0.0-20190812130613-5613f843fdc8/go.mod h1:U1gYCDLM1Kg0dG0PxUjlT09+l6/TdUZKx0FQ2CocJUU= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -292,9 +290,17 @@ github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5P github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/cloudfoundry-community/go-cfclient v0.0.0-20201123235753-4f46d6348a05 h1:5Hbn8fSLiRX8dje5E22dk/6SuJnbd+pnwjFCGyb8St0= github.com/cloudfoundry-community/go-cfclient v0.0.0-20201123235753-4f46d6348a05/go.mod h1:UGbOgL5sX52jB/PUVKOeRC17QYX4Afsq+bsIeMCD4VA= +github.com/cloudfoundry-incubator/bbs v0.0.0-20210901222458-044174eef746 h1:5UAdjwPgmn5k5iNjTeaOP0MzwVK11GR34vFEcXeyB24= +github.com/cloudfoundry-incubator/bbs v0.0.0-20210901222458-044174eef746/go.mod h1:Q0VRlLGjj5O7wRZ2EfmrEfXpHEgz3LABchAFJe3lpnw= +github.com/cloudfoundry-incubator/executor v0.0.0-20210913224247-1c8b2ff139d9/go.mod h1:PeB7A0Ieb4rpqQ//ID5x0g2oiUCAQLtmZfgP8WnepOU= +github.com/cloudfoundry/dropsonde v1.0.0/go.mod h1:6zwvrWK5TpxBVYi1cdkE5WDsIO8E0n7qAJg3wR9B67c= +github.com/cloudfoundry/gosteno v0.0.0-20150423193413-0c8581caea35/go.mod h1:3YBPUR85RIrvaUTdA1dL38YSp6s3OHu1xrWLkGt2Mog= +github.com/cloudfoundry/loggregatorlib v0.0.0-20170823162133-36eddf15ef12/go.mod h1:ucj7+svyACshmxV3Zze2NAcEcdbBf9scZYR+QKCX9/w= +github.com/cloudfoundry/sonde-go v0.0.0-20171206171820-b33733203bb4/go.mod h1:GS0pCHd7onIsewbw8Ue9qa9pZPv2V88cUZDttK6KzgI= github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313/go.mod h1:P1wt9Z3DP8O6W3rvwCt0REIlshg1InHImaLW0t3ObY0= github.com/cobaugh/osrelease v0.0.0-20181218015638-a93a0a55a249 h1:R0IDH8daQ3lODvu8YtxnIqqth5qMGCJyADoUQvmLx4o= github.com/cobaugh/osrelease v0.0.0-20181218015638-a93a0a55a249/go.mod h1:EHKW9yNEYSBpTKzuu7Y9oOrft/UlzH57rMIB03oev6M= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= @@ -393,12 +399,9 @@ github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgU github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= github.com/coredns/corefile-migration v1.0.10/go.mod h1:RMy/mXdeDlYwzt0vdMEJvT2hGJ2I86/eO0UdXmH9XNI= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY= github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.25+incompatible h1:0GQEw6h3YnuOVdtwygkIfJ+Omx0tZ8/QkVyXI4LkbeY= -github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= @@ -527,7 +530,6 @@ github.com/go-bindata/go-bindata v3.1.1+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.62.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -607,8 +609,9 @@ github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-test/deep v1.0.5 h1:AKODKU3pDH1RzZzm6YZu77YWtEAq6uh1rLIAQlay2qc= -github.com/go-test/deep v1.0.5/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= +github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/goccy/go-yaml v1.7.5/go.mod h1:wS4gNoLalDSJxo/SpngzPQ2BN4uuZVLCmbM4S3vd4+Y= @@ -666,9 +669,8 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkYFkPcDKwRXegd+iM6E7matEszMG5HhwytU8= github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= @@ -684,7 +686,6 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= @@ -742,9 +743,8 @@ github.com/gosnmp/gosnmp v1.32.0/go.mod h1:EIp+qkEpXoVsyZxXKy0AmXQx0mCHMMcIhXXvN github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 h1:0IKlLyQ3Hs9nDaiK5cSHAGmcQEIC8l2Ts1u6x5Dfrqg= github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.12.2 h1:D0EVSTwQoQOyfY35QNSuPJA4jpZRtkoGYWQMB7XNg5o= @@ -815,10 +815,9 @@ github.com/heketi/heketi v9.0.1-0.20190917153846-c2e2a4ab7ab9+incompatible/go.mo github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6/go.mod h1:xGMAM8JLi7UkZt1i4FQeQy0R2T8GLUwQhOP5M1gBhy4= github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/ianlancetaylor/cgosymbolizer v0.0.0-20201204192058-7acc97e53614 h1:C4ihxAUmsEyBsTEIqKaIsTTeGk0c9Oy7K1AbRnw3lTc= -github.com/ianlancetaylor/cgosymbolizer v0.0.0-20201204192058-7acc97e53614/go.mod h1:a5aratAVTWyz+nJMmDsN8O4XTfaLfdAsB1ysCmZX5Bw= +github.com/ianlancetaylor/cgosymbolizer v0.0.0-20210303021718-7cb7081f6b86 h1:japbUgsq9/hsjyeO/XNeY9GthNqCVOOmL5CDadVWSsQ= +github.com/ianlancetaylor/cgosymbolizer v0.0.0-20210303021718-7cb7081f6b86/go.mod h1:a5aratAVTWyz+nJMmDsN8O4XTfaLfdAsB1ysCmZX5Bw= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/iceber/iouring-go v0.0.0-20210726032807-b073cc83b2b8/go.mod h1:LEzdaZarZ5aqROlLIwJ4P7h3+4o71008fSy6wpaEB+s= @@ -890,13 +889,11 @@ github.com/kjk/lzma v0.0.0-20161016003348-3fd93898850d/go.mod h1:phT/jsRPBAEqjAi github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.13 h1:eSvu8Tmq6j2psUJqJrLcWH6K3w5Dwc+qipbaA6eVEN4= github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/pgzip v1.2.4 h1:TQ7CNpYKovDOmqzRHKxJh0BeaBI7UdQZYc6p7pMQh1A= github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= -github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -917,20 +914,19 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/lebauce/aptly v0.7.2-0.20210723103859-345a32860f4d h1:6k4uyp3yRFzEmzQZjnneNYhIvNvvcu9XIvFyalzuBAE= github.com/lebauce/aptly v0.7.2-0.20210723103859-345a32860f4d/go.mod h1:Uot/EzgnIw6okZTyEZ/Q8+er5ZXy2Bqrrabr/M6OxUE= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.3 h1:v9QZf2Sn6AmjXtQeFpdoq/eaNtYP6IN+7lcrygsIAtg= +github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libopenstorage/openstorage v1.0.0/go.mod h1:Sp1sIObHjat1BeXhfMqLZ14wnOzEhNx2YQedreMcUyc= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= +github.com/loggregator/go-bindata v0.0.0-20190422223605-5f11cfb2d7d9/go.mod h1:PvsJfK9t/8OdGvSanpYlwJ1EPoJ/hwT3c52txAzqooY= github.com/lpabon/godbc v0.1.1/go.mod h1:Jo9QV0cf3U6jZABgiJ2skINAXb9j8m51r07g4KI92ZA= github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f/go.mod h1:JpH9J1c9oX6otFSgdUHwUBUizmKlrMjxWnIAjff4m04= github.com/lucas-clemente/quic-clients v0.1.0/go.mod h1:y5xVIEoObKqULIKivu+gD/LU90pL73bTdtQjPBvtCBk= github.com/lucas-clemente/quic-go v0.10.2/go.mod h1:hvaRS9IHjFLMq76puFJeWNfmn+H70QZ/CXoxqw9bzao= github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced/go.mod h1:NCcRLrOTZbzhZvixZLlERbJtDtYsmMw8Jc4vS8Z0g58= -github.com/lxn/walk v0.0.0-20180521183810-02935bac0ab8/go.mod h1:E23UucZGqpuUANJooIbHWCufXvOcT6E7Stq81gU+CSQ= -github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4/go.mod h1:ouWl4wViUNh8tPSIwxTVMuS014WakR1hqvBc2I0bMoA= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -1009,7 +1005,6 @@ github.com/mindprince/gonvml v0.0.0-20190828220739-9ebdce4bb989/go.mod h1:2eu9pR github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/copystructure v1.1.2/go.mod h1:EBArHfARyrSWO/+Wyr9zwEkc6XMFB9XyNgFNmRkZZU4= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -1024,7 +1019,6 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mkrautz/goar v0.0.0-20150919110319-282caa8bd9da h1:Iu5QFXIMK/YrHJ0NgUnK0rqYTTyb0ldt/rqNenAj39U= github.com/mkrautz/goar v0.0.0-20150919110319-282caa8bd9da/go.mod h1:NfnmoBY0gGkr3/NmI+DP/UXbZvOCurCUYAzOdYJjlOc= github.com/moby/ipvs v1.0.1/go.mod h1:2pngiyseZbIKXNv7hsKj3O9UEz30c53MT9005gt2hxQ= @@ -1098,8 +1092,10 @@ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= +github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1109,8 +1105,9 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= +github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1173,9 +1170,11 @@ github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4/v4 v4.0.3 h1:vNQKSVZNYUEAvRY9FaUXAF1XPbSOHJtDTiP41kzDz2E= github.com/pierrec/lz4/v4 v4.0.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pierrec/lz4/v4 v4.1.3 h1:/dvQpkb0o1pVlSgKNQqfkavlnXaIK+hJ0LXsKRUN9D4= -github.com/pierrec/lz4/v4 v4.1.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pivotal-golang/clock v1.0.0/go.mod h1:+mfK55nFzC6GZpxsSI3MpI4NkRjsRCaVjf1o/QqUNkc= +github.com/pivotal-golang/lager v2.0.0+incompatible h1:RJfBQxoH+1xT8GfxIaMNq+FMcYqx50fKdq7MUkuKzv0= +github.com/pivotal-golang/lager v2.0.0+incompatible/go.mod h1:EJZBAWMz/TvxVfLaBRwCv+gszrSByWbqQBRwfVbUhvM= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1187,6 +1186,7 @@ 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/poy/eachers v0.0.0-20181020210610-23942921fe77/go.mod h1:x1vqpbcMW9T/KRcQ4b48diSiSVtYgvwQ5xzDByEg4WE= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -1362,10 +1362,10 @@ github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.6 h1:i+SbKraHhnrf9M5MYmvQhFnbLhAXSDWF8WWsuyRdocw= github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw= -github.com/tklauser/go-sysconf v0.3.4 h1:HT8SVixZd3IzLdfs/xlpq0jeSfTX57g1v6wB1EuzV7M= -github.com/tklauser/go-sysconf v0.3.4/go.mod h1:Cl2c8ZRWfHD5IrfHo9VN+FX9kCFjIOyVklgXycLB6ek= -github.com/tklauser/numcpus v0.2.1 h1:ct88eFm+Q7m2ZfXJdan1xYoXKlmwsfP+k88q05KvlZc= -github.com/tklauser/numcpus v0.2.1/go.mod h1:9aU+wOc6WjUIZEwWMP62PL/41d65P+iks1gBkr4QyP8= +github.com/tklauser/go-sysconf v0.3.9 h1:JeUVdAOWhhxVcU6Eqr/ATFHgXk/mmiItdKeJPev3vTo= +github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= +github.com/tklauser/numcpus v0.3.0 h1:ILuRUQBtssgnxw0XXIjKUC56fgnOrFoQQ/4+DeU2biQ= +github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc h1:yUaosFVTJwnltaHbSNC3i82I92quFs+OFPRl8kNMVwo= @@ -1383,9 +1383,8 @@ github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVM github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.7 h1:YvTNdFzX6+W5m9msiYg/zpkSURPPtOlzbqYjrFn7Yt4= github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= -github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVUZZQ= @@ -1440,11 +1439,11 @@ github.com/zorkian/go-datadog-api v2.30.0+incompatible h1:R4ryGocppDqZZbnNc5EDR8 github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489 h1:1JFLBqwIgdyHN1ZtgjTBwO+blA6gVOmZurpiMEsETKo= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd v3.3.25+incompatible h1:V1RzkZJj9LqsJRy+TUBgpWSbZXITLB819lstuTFoZOY= -go.etcd.io/etcd v3.3.25+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI= go.etcd.io/etcd/api/v3 v3.5.0 h1:GsV3S+OfZEOCNXdtNkBSR7kgLobAa/SO6tCxRa0GAYw= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0 h1:2aQv6F436YnN7I4VbI8PPYrBhu+SmrTaADcf8Mi/6PU= @@ -1462,9 +1461,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.22.6 h1:BdkrbWrzDlV9dnbzoP7sfN+dHheJ4J9JOaYxcUDL+ok= -go.opencensus.io v0.22.6/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= @@ -1518,7 +1516,6 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210317152858-513c2a44f670/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1623,8 +1620,10 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1676,6 +1675,7 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1748,7 +1748,6 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210123111255-9b0068b26619/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210216163648-f7da38b97c65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210217105451-b926d437f341/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1761,8 +1760,9 @@ golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210601080250-7ecdf8ef093b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71 h1:ikCpsnYR+Ew0vu99XlDp55lGgDJdIMx3f4a18jfse/s= +golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1926,7 +1926,6 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= @@ -1961,7 +1960,6 @@ google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/l google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/DataDog/dd-trace-go.v1 v1.30.0 h1:yJJrDYzAlUsDPpAVBjv4VFnXKTbgvaJFTX0646xDPi4= gopkg.in/DataDog/dd-trace-go.v1 v1.30.0/go.mod h1:SnKViq44dv/0gjl9RpkP0Y2G3BJSRkp6eYdCSu39iI8= -gopkg.in/Knetic/govaluate.v3 v3.0.0/go.mod h1:csKLBORsPbafmSCGTEh3U7Ozmsuq8ZSIlKk1bcqph0E= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= @@ -1988,7 +1986,6 @@ gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdOD gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.55.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mcuadros/go-syslog.v2 v2.2.1/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm0aKH+5zpt2U= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473/go.mod h1:N1eN2tsCx0Ydtgjl4cqmbRCsY4/+z4cYDeqwZTk6zog= @@ -2094,6 +2091,7 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl k8s.io/utils v0.0.0-20200912215256-4140de9c8800/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/pkg/agent/server/agent.go b/pkg/agent/server/agent.go index 448f0aa4..b04685d4 100644 --- a/pkg/agent/server/agent.go +++ b/pkg/agent/server/agent.go @@ -120,6 +120,10 @@ func (p *agentServer) start(ctx context.Context) error { return err } + if err := p.startProcess(); err != nil { + return err + } + if err := p.startDetectCloudProvider(); err != nil { return nil } diff --git a/pkg/agent/server/process.go b/pkg/agent/server/process.go new file mode 100644 index 00000000..dbf0aa49 --- /dev/null +++ b/pkg/agent/server/process.go @@ -0,0 +1,543 @@ +package server + +import ( + "context" + "fmt" + "math/rand" + "net/http" + "strconv" + "sync" + "sync/atomic" + "time" + + "github.com/DataDog/datadog-agent/pkg/forwarder" + "github.com/DataDog/datadog-agent/pkg/metadata/host" + "github.com/DataDog/datadog-agent/pkg/process/checks" + "github.com/DataDog/datadog-agent/pkg/process/config" + "github.com/DataDog/datadog-agent/pkg/process/heartbeat" + "github.com/DataDog/datadog-agent/pkg/process/statsd" + "github.com/DataDog/datadog-agent/pkg/process/util" + "github.com/DataDog/datadog-agent/pkg/process/util/api" + apicfg "github.com/DataDog/datadog-agent/pkg/process/util/api/config" + "github.com/DataDog/datadog-agent/pkg/process/util/api/headers" + "github.com/DataDog/datadog-agent/pkg/util/kubernetes/clustername" + "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/DataDog/datadog-agent/pkg/util/profiling" + model "github.com/n9e/agent-payload/process" + "github.com/n9e/n9e-agentd/pkg/options" +) + +func (p *agentServer) startProcess() error { + cf := p.config + + if !cf.ProcessConfig.Enabled { + return nil + } + + cfg, err := config.NewAgentConfig() + if err != nil { + return fmt.Errorf("Error parsing config: %s", err) + } + + hostInfo := host.GetStatusInformation() + log.Infof("running on platform: %s", hostInfo.Platform) + + if err := initInfo(cfg); err != nil { + return fmt.Errorf("Error initializing info: %s", err) + } + + if err := statsd.Configure(p.config.Statsd.Host, p.config.Statsd.Port); err != nil { + return fmt.Errorf("Error configuring statsd: %s", err) + } + + // Initialize system-probe heartbeats + sysprobeMonitor, err := heartbeat.NewModuleMonitor(heartbeat.Options{ + KeysPerDomain: apicfg.KeysPerDomains(cfg.APIEndpoints), + SysprobeSocketPath: cfg.SystemProbeAddress, + HostName: cfg.HostName, + TagVersion: options.Version, + TagRevision: options.Revision, + }) + go func() { + <-p.ctx.Done() + sysprobeMonitor.Stop() + }() + + if err != nil { + log.Warnf("failed to initialize system-probe monitor: %s", err) + } else { + sysprobeMonitor.Every(15 * time.Second) + } + + // update docker socket path in info + dockerSock, err := util.GetDockerSocketPath() + if err != nil { + log.Debugf("Docker is not available on this host") + } + // we shouldn't quit because docker is not required. If no docker docket is available, + // we just pass down empty string + updateDockerSocket(dockerSock) + + if cfg.ProfilingEnabled { + if err := enableProfiling(cfg); err != nil { + log.Warnf("failed to enable profiling: %s", err) + } else { + log.Info("start profiling process-agent") + } + go func() { + <-p.ctx.Done() + profiling.Stop() + }() + } + + cl, err := NewCollector(cfg, p.ctx) + if err != nil { + return fmt.Errorf("Error creating collector: %s", err) + } + if err := cl.run(); err != nil { + return fmt.Errorf("Error starting collector: %s", err) + } + + return nil +} + +func enableProfiling(cfg *config.AgentConfig) error { + // allow full url override for development use + //site := fmt.Sprintf(profiling.ProfileURLTemplate, cfg.ProfilingSite) + //if cfg.ProfilingURL != "" { + // site = cfg.ProfilingURL + //} + + return profiling.Start( + cfg.ProfilingSite, + cfg.ProfilingEnvironment, + "process-agent", + cfg.ProfilingPeriod, + cfg.ProfilingCPUDuration, + cfg.ProfilingMutexFraction, + cfg.ProfilingBlockRate, + cfg.ProfilingWithGoroutines, + fmt.Sprintf("version:%v", options.Version), + ) +} + +type checkResult struct { + name string + payloads []checkPayload + sizeInBytes int64 +} + +func (cr *checkResult) Weight() int64 { + return cr.sizeInBytes +} + +func (cr *checkResult) Type() string { + return cr.name +} + +var _ api.WeightedItem = &checkResult{} + +type checkPayload struct { + body []byte + headers http.Header +} + +// Collector will collect metrics from the local system and ship to the backend. +type Collector struct { + ctx context.Context + + // Set to 1 if enabled 0 is not. We're using an integer + // so we can use the sync/atomic for thread-safe access. + realTimeEnabled int32 + + groupID int32 + + rtIntervalCh chan time.Duration + cfg *config.AgentConfig + + // counters for each type of check + runCounters sync.Map + enabledChecks []checks.Check + + // Controls the real-time interval, can change live. + realTimeInterval time.Duration +} + +// NewCollector creates a new Collector +func NewCollector(cfg *config.AgentConfig, ctx context.Context) (Collector, error) { + sysInfo, err := checks.CollectSystemInfo(cfg) + if err != nil { + return Collector{}, err + } + + enabledChecks := make([]checks.Check, 0) + for _, c := range checks.All { + if cfg.CheckIsEnabled(c.Name()) { + c.Init(cfg, sysInfo) + enabledChecks = append(enabledChecks, c) + } + } + + return NewCollectorWithChecks(cfg, enabledChecks, ctx), nil +} + +// NewCollectorWithChecks creates a new Collector +func NewCollectorWithChecks(cfg *config.AgentConfig, checks []checks.Check, ctx context.Context) Collector { + return Collector{ + ctx: ctx, + rtIntervalCh: make(chan time.Duration), + cfg: cfg, + groupID: rand.Int31(), + enabledChecks: checks, + + // Defaults for real-time on start + realTimeInterval: 2 * time.Second, + realTimeEnabled: 0, + } +} + +func (l *Collector) runCheck(c checks.Check, results *api.WeightedQueue) { + runCounter := int32(1) + if rc, ok := l.runCounters.Load(c.Name()); ok { + runCounter = rc.(int32) + 1 + } + l.runCounters.Store(c.Name(), runCounter) + + start := time.Now() + // update the last collected timestamp for info + updateLastCollectTime(start) + messages, err := c.Run(l.cfg, atomic.AddInt32(&l.groupID, 1)) + if err != nil { + log.Errorf("Unable to run check '%s': %s", c.Name(), err) + return + } + + payloads := make([]checkPayload, 0, len(messages)) + sizeInBytes := 0 + + for _, m := range messages { + body, err := api.EncodePayload(m) + if err != nil { + log.Errorf("Unable to encode message: %s", err) + continue + } + + extraHeaders := make(http.Header) + extraHeaders.Set(headers.TimestampHeader, strconv.Itoa(int(start.Unix()))) + extraHeaders.Set(headers.HostHeader, l.cfg.HostName) + extraHeaders.Set(headers.ProcessVersionHeader, options.Version) + extraHeaders.Set(headers.ContainerCountHeader, strconv.Itoa(getContainerCount(m))) + + if l.cfg.Orchestrator.OrchestrationCollectionEnabled { + if cid, err := clustername.GetClusterID(); err == nil && cid != "" { + extraHeaders.Set(headers.ClusterIDHeader, cid) + } + } + + payloads = append(payloads, checkPayload{ + body: body, + headers: extraHeaders, + }) + + sizeInBytes += len(body) + } + + result := &checkResult{ + name: c.Name(), + payloads: payloads, + sizeInBytes: int64(sizeInBytes), + } + + results.Add(result) + + // update proc and container count for info + updateProcContainerCount(messages) + + if !c.RealTime() { + d := time.Since(start) + switch { + case runCounter < 5: + log.Infof("Finished %s check #%d in %s", c.Name(), runCounter, d) + case runCounter == 5: + log.Infof("Finished %s check #%d in %s. First 5 check runs finished, next runs will be logged every 20 runs.", c.Name(), runCounter, d) + case runCounter%20 == 0: + log.Infof("Finish %s check #%d in %s", c.Name(), runCounter, d) + } + } +} + +func (l *Collector) run() error { + eps := make([]string, 0, len(l.cfg.APIEndpoints)) + for _, e := range l.cfg.APIEndpoints { + eps = append(eps, e.Endpoint.String()) + } + orchestratorEps := make([]string, 0, len(l.cfg.Orchestrator.OrchestratorEndpoints)) + for _, e := range l.cfg.Orchestrator.OrchestratorEndpoints { + orchestratorEps = append(orchestratorEps, e.Endpoint.String()) + } + log.Infof("Starting process-agent for host=%s, endpoints=%s, orchestrator endpoints=%s, enabled checks=%v", l.cfg.HostName, eps, orchestratorEps, l.cfg.EnabledChecks) + + processResults := api.NewWeightedQueue(l.cfg.QueueSize, int64(l.cfg.ProcessQueueBytes)) + podResults := api.NewWeightedQueue(l.cfg.QueueSize, int64(l.cfg.Orchestrator.PodQueueBytes)) + + var wg sync.WaitGroup + + wg.Add(1) + go func() { + defer wg.Done() + + heartbeat := time.NewTicker(15 * time.Second) + defer heartbeat.Stop() + + queueSizeTicker := time.NewTicker(10 * time.Second) + defer queueSizeTicker.Stop() + + queueLogTicker := time.NewTicker(time.Minute) + defer queueLogTicker.Stop() + + tags := []string{ + fmt.Sprintf("version:%s", options.Version), + fmt.Sprintf("revision:%s", options.Revision), + } + for { + select { + case <-heartbeat.C: + statsd.Client.Gauge("datadog.process.agent", 1, tags, 1) //nolint:errcheck + case <-queueSizeTicker.C: + updateQueueBytes(processResults.Weight(), podResults.Weight()) + updateQueueSize(processResults.Len(), podResults.Len()) + case <-queueLogTicker.C: + processSize, podSize := processResults.Len(), podResults.Len() + if processSize > 0 || podSize > 0 { + log.Infof( + "Delivery queues: process[size=%d, weight=%d], pod[size=%d, weight=%d]", + processSize, processResults.Weight(), podSize, podResults.Weight(), + ) + } + case <-l.ctx.Done(): + return + } + } + }() + + processForwarderOpts := forwarder.NewOptions(apicfg.KeysPerDomains(l.cfg.APIEndpoints)) + processForwarderOpts.DisableAPIKeyChecking = true + processForwarderOpts.RetryQueuePayloadsTotalMaxSize = l.cfg.ProcessQueueBytes // Allow more in-flight requests than the default + processForwarder := forwarder.NewDefaultForwarder(processForwarderOpts) + + podForwarderOpts := forwarder.NewOptions(apicfg.KeysPerDomains(l.cfg.Orchestrator.OrchestratorEndpoints)) + podForwarderOpts.DisableAPIKeyChecking = true + podForwarderOpts.RetryQueuePayloadsTotalMaxSize = l.cfg.ProcessQueueBytes // Allow more in-flight requests than the default + podForwarder := forwarder.NewDefaultForwarder(podForwarderOpts) + + if err := processForwarder.Start(); err != nil { + return fmt.Errorf("error starting forwarder: %s", err) + } + + if err := podForwarder.Start(); err != nil { + return fmt.Errorf("error starting pod forwarder: %s", err) + } + + wg.Add(1) + go func() { + defer wg.Done() + l.consumePayloads(processResults, processForwarder) + }() + + wg.Add(1) + go func() { + defer wg.Done() + l.consumePayloads(podResults, podForwarder) + }() + + for _, c := range l.enabledChecks { + results := processResults + if c.Name() == checks.Pod.Name() { + results = podResults + } + + wg.Add(1) + go func(c checks.Check, results *api.WeightedQueue) { + defer wg.Done() + + // Run the check the first time to prime the caches. + if !c.RealTime() { + l.runCheck(c, results) + } + + ticker := time.NewTicker(l.cfg.CheckInterval(c.Name())) + for { + select { + case <-ticker.C: + realTimeEnabled := atomic.LoadInt32(&l.realTimeEnabled) == 1 + if !c.RealTime() || realTimeEnabled { + l.runCheck(c, results) + } + case d := <-l.rtIntervalCh: + // Live-update the ticker. + if c.RealTime() { + ticker.Stop() + ticker = time.NewTicker(d) + } + case _, ok := <-l.ctx.Done(): + if !ok { + return + } + } + } + }(c, results) + } + + go func() { + <-l.ctx.Done() + wg.Wait() + + processForwarder.Stop() + podForwarder.Stop() + }() + return nil +} + +func (l *Collector) consumePayloads(results *api.WeightedQueue, fwd forwarder.Forwarder) { + for { + // results.Poll() will block until either `exit` is closed, or an item is available on the queue (a check run occurs and adds data) + item, ok := results.Poll(l.ctx) + if !ok { + return + } + result := item.(*checkResult) + for _, payload := range result.payloads { + var ( + forwarderPayload = forwarder.Payloads{&payload.body} + responses chan forwarder.Response + err error + updateRTStatus = true + ) + + switch result.name { + case checks.Process.Name(): + responses, err = fwd.SubmitProcessChecks(forwarderPayload, payload.headers) + case checks.RTProcess.Name(): + responses, err = fwd.SubmitRTProcessChecks(forwarderPayload, payload.headers) + case checks.Container.Name(): + responses, err = fwd.SubmitContainerChecks(forwarderPayload, payload.headers) + case checks.RTContainer.Name(): + responses, err = fwd.SubmitRTContainerChecks(forwarderPayload, payload.headers) + case checks.Connections.Name(): + responses, err = fwd.SubmitConnectionChecks(forwarderPayload, payload.headers) + case checks.Pod.Name(): + // Orchestrator intake response does not change RT checks enablement or interval + updateRTStatus = false + responses, err = fwd.SubmitOrchestratorChecks(forwarderPayload, payload.headers, checks.Pod.Name()) + default: + err = fmt.Errorf("unsupported payload type: %s", result.name) + } + + if err != nil { + log.Errorf("Unable to submit payload: %s", err) + continue + } + + if statuses := readResponseStatuses(result.name, responses); len(statuses) > 0 { + if updateRTStatus { + l.updateRTStatus(statuses) + } + } + } + } +} + +func (l *Collector) updateRTStatus(statuses []*model.CollectorStatus) { + curEnabled := atomic.LoadInt32(&l.realTimeEnabled) == 1 + + // If any of the endpoints wants real-time we'll do that. + // We will pick the maximum interval given since generally this is + // only set if we're trying to limit load on the backend. + shouldEnableRT := false + maxInterval := 0 * time.Second + activeClients := int32(0) + for _, s := range statuses { + shouldEnableRT = shouldEnableRT || (s.ActiveClients > 0 && l.cfg.AllowRealTime) + if s.ActiveClients > 0 { + activeClients += s.ActiveClients + } + interval := time.Duration(s.Interval) * time.Second + if interval > maxInterval { + maxInterval = interval + } + } + + if curEnabled && !shouldEnableRT { + log.Info("Detected 0 clients, disabling real-time mode") + atomic.StoreInt32(&l.realTimeEnabled, 0) + } else if !curEnabled && shouldEnableRT { + log.Infof("Detected %d active clients, enabling real-time mode", activeClients) + atomic.StoreInt32(&l.realTimeEnabled, 1) + } + + if maxInterval != l.realTimeInterval { + l.realTimeInterval = maxInterval + if l.realTimeInterval <= 0 { + l.realTimeInterval = 2 * time.Second + } + // Pass along the real-time interval, one per check, so that every + // check routine will see the new interval. + for range l.enabledChecks { + l.rtIntervalCh <- l.realTimeInterval + } + log.Infof("real time interval updated to %s", l.realTimeInterval) + } +} + +// getContainerCount returns the number of containers in the message body +func getContainerCount(mb model.MessageBody) int { + switch v := mb.(type) { + case *model.CollectorProc: + return len(v.GetContainers()) + case *model.CollectorRealTime: + return len(v.GetContainerStats()) + case *model.CollectorContainer: + return len(v.GetContainers()) + case *model.CollectorContainerRealTime: + return len(v.GetStats()) + case *model.CollectorConnections: + return 0 + } + return 0 +} + +func readResponseStatuses(checkName string, responses <-chan forwarder.Response) []*model.CollectorStatus { + var statuses []*model.CollectorStatus + + for response := range responses { + if response.Err != nil { + log.Errorf("[%s] Error from %s: %s", checkName, response.Domain, response.Err) + continue + } + + if response.StatusCode >= 300 { + log.Errorf("[%s] Invalid response from %s: %d -> %s", checkName, response.Domain, response.StatusCode, response.Err) + continue + } + + r, err := model.DecodeMessage(response.Body) + if err != nil { + log.Errorf("[%s] Could not decode response body: %s", checkName, err) + continue + } + + switch r.Header.Type { + case model.TypeResCollector: + rm := r.Body.(*model.ResCollector) + if len(rm.Message) > 0 { + log.Errorf("[%s] Error in response from %s: %s", checkName, response.Domain, rm.Message) + } else { + statuses = append(statuses, rm.Status) + } + default: + log.Errorf("[%s] Unexpected response type from %s: %d", checkName, response.Domain, r.Header.Type) + } + } + + return statuses +} diff --git a/pkg/agent/server/process_info.go b/pkg/agent/server/process_info.go new file mode 100644 index 00000000..8f830cd4 --- /dev/null +++ b/pkg/agent/server/process_info.go @@ -0,0 +1,338 @@ +package server + +import ( + "bufio" + "encoding/json" + "expvar" + "fmt" + "html/template" + "io" + "net/http" + "os" + "strings" + "sync" + "time" + + "github.com/DataDog/datadog-agent/pkg/process/config" + "github.com/DataDog/datadog-agent/pkg/process/util" + model "github.com/n9e/agent-payload/process" + "github.com/n9e/n9e-agentd/pkg/options" +) + +var ( + infoMutex sync.RWMutex + infoOnce sync.Once + infoStart = time.Now() + infoNotRunningTmpl *template.Template + infoTmpl *template.Template + infoErrorTmpl *template.Template + infoDockerSocket string + infoLastCollectTime string + infoProcCount int + infoContainerCount int + infoProcessQueueSize int + infoPodQueueSize int + infoProcessQueueBytes int + infoPodQueueBytes int +) + +const ( + infoTmplSrc = `{{.Banner}} +{{.Program}} +{{.Banner}} + + Pid: {{.Status.Pid}} + Hostname: {{.Status.Config.HostName}} + Uptime: {{.Status.Uptime}} seconds + Mem alloc: {{.Status.MemStats.Alloc}} bytes + + Last collection time: {{.Status.LastCollectTime}}{{if ne .Status.DockerSocket ""}} + Docker socket: {{.Status.DockerSocket}}{{end}} + Number of processes: {{.Status.ProcessCount}} + Number of containers: {{.Status.ContainerCount}} + Process Queue length: {{.Status.ProcessQueueSize}} + Pod Queue length: {{.Status.PodQueueSize}} + Process Bytes enqueued: {{.Status.ProcessQueueBytes}} + Pod Bytes enqueued: {{.Status.PodQueueBytes}} + + Logs: {{.Status.Config.LogFile}}{{if .Status.ProxyURL}} + HttpProxy: {{.Status.ProxyURL}}{{end}}{{if ne .Status.ContainerID ""}} + Container ID: {{.Status.ContainerID}}{{end}} + +` + infoNotRunningTmplSrc = `{{.Banner}} +{{.Program}} +{{.Banner}} + + Not running + +` + infoErrorTmplSrc = `{{.Banner}} +{{.Program}} +{{.Banner}} + + Error: {{.Error}} + +` +) + +func publishUptime() interface{} { + return int(time.Since(infoStart) / time.Second) +} + +func publishVersion() interface{} { + return infoVersion{ + Version: options.Version, + GitCommit: options.Revision, + BuildDate: options.BuildDate, + GoVersion: options.GoVersion, + } +} + +func publishDockerSocket() interface{} { + infoMutex.RLock() + defer infoMutex.RUnlock() + return infoDockerSocket +} + +func updateDockerSocket(path string) { + infoMutex.Lock() + defer infoMutex.Unlock() + infoDockerSocket = path +} + +func publishLastCollectTime() interface{} { + infoMutex.RLock() + defer infoMutex.RUnlock() + return infoLastCollectTime +} + +func updateLastCollectTime(t time.Time) { + infoMutex.Lock() + defer infoMutex.Unlock() + infoLastCollectTime = t.Format("2006-01-02 15:04:05") +} + +func publishProcCount() interface{} { + infoMutex.RLock() + defer infoMutex.RUnlock() + return infoProcCount +} + +func publishContainerCount() interface{} { + infoMutex.RLock() + defer infoMutex.RUnlock() + return infoContainerCount +} + +func updateProcContainerCount(msgs []model.MessageBody) { + var procCount, containerCount int + for _, m := range msgs { + switch msg := m.(type) { + case *model.CollectorContainer: + containerCount += len(msg.Containers) + case *model.CollectorProc: + procCount += len(msg.Processes) + containerCount += len(msg.Containers) + } + } + + infoMutex.Lock() + defer infoMutex.Unlock() + infoProcCount = procCount + infoContainerCount = containerCount +} + +func updateQueueSize(processQueueSize, podQueueSize int) { + infoMutex.Lock() + defer infoMutex.Unlock() + infoProcessQueueSize = processQueueSize + infoPodQueueSize = podQueueSize +} + +func publishProcessQueueSize() interface{} { + infoMutex.RLock() + defer infoMutex.RUnlock() + return infoProcessQueueSize +} + +func publishPodQueueSize() interface{} { + infoMutex.RLock() + defer infoMutex.RUnlock() + return infoPodQueueSize +} + +func updateQueueBytes(processQueueBytes, podQueueBytes int64) { + infoMutex.Lock() + defer infoMutex.Unlock() + infoProcessQueueBytes = int(processQueueBytes) + infoPodQueueBytes = int(podQueueBytes) +} + +func publishProcessQueueBytes() interface{} { + infoMutex.RLock() + defer infoMutex.RUnlock() + return infoProcessQueueBytes +} + +func publishPodQueueBytes() interface{} { + infoMutex.RLock() + defer infoMutex.RUnlock() + return infoPodQueueBytes +} + +func publishContainerID() interface{} { + cgroupFile := "/proc/self/cgroup" + if !util.PathExists(cgroupFile) { + return nil + } + f, err := os.Open(cgroupFile) + if err != nil { + return nil + } + defer func() { _ = f.Close() }() + scanner := bufio.NewScanner(f) + // the content of the file should have "docker/" on each line, the last + // bit of each line after the "/" should be the container id, e.g. + // + // 11:name=systemd:/docker/49de419da182a44f29659b9761a963543cdbf1dee8b51313b9104edec4461c58 + // + // we could just extract that and treat it as current container id + containerID := "" + for scanner.Scan() { + line := scanner.Text() + if strings.Contains(line, "docker/") { + slices := strings.Split(line, "/") + // it's not totally safe to assume the format, but it's the only thing we can do for now + if len(slices) == 3 { + containerID = slices[len(slices)-1] + break + } + } + } + return containerID +} + +func getProgramBanner(version string) (string, string) { + program := fmt.Sprintf("Processes and Containers Agent (v %s)", version) + banner := strings.Repeat("=", len(program)) + return program, banner +} + +type infoVersion struct { + Version string + GitCommit string + GitBranch string + BuildDate string + GoVersion string +} + +// StatusInfo is a structure to get information from expvar and feed to template +type StatusInfo struct { + Pid int `json:"pid"` + Uptime int `json:"uptime"` + MemStats struct{ Alloc uint64 } `json:"memstats"` + Version infoVersion `json:"version"` + Config config.AgentConfig `json:"config"` + DockerSocket string `json:"docker_socket"` + LastCollectTime string `json:"last_collect_time"` + ProcessCount int `json:"process_count"` + ContainerCount int `json:"container_count"` + ProcessQueueSize int `json:"process_queue_size"` + PodQueueSize int `json:"pod_queue_size"` + ProcessQueueBytes int `json:"process_queue_bytes"` + PodQueueBytes int `json:"pod_queue_bytes"` + ContainerID string `json:"container_id"` + ProxyURL string `json:"proxy_url"` +} + +func initInfo(_ *config.AgentConfig) error { + var err error + + funcMap := template.FuncMap{ + "add": func(a, b int64) int64 { + return a + b + }, + "percent": func(v float64) string { + return fmt.Sprintf("%02.1f", v*100) + }, + } + infoOnce.Do(func() { + expvar.NewInt("pid").Set(int64(os.Getpid())) + expvar.Publish("uptime", expvar.Func(publishUptime)) + expvar.Publish("version", expvar.Func(publishVersion)) + expvar.Publish("docker_socket", expvar.Func(publishDockerSocket)) + expvar.Publish("last_collect_time", expvar.Func(publishLastCollectTime)) + expvar.Publish("process_count", expvar.Func(publishProcCount)) + expvar.Publish("container_count", expvar.Func(publishContainerCount)) + expvar.Publish("process_queue_size", expvar.Func(publishProcessQueueSize)) + expvar.Publish("pod_queue_size", expvar.Func(publishPodQueueSize)) + expvar.Publish("process_queue_bytes", expvar.Func(publishProcessQueueBytes)) + expvar.Publish("pod_queue_bytes", expvar.Func(publishPodQueueBytes)) + expvar.Publish("container_id", expvar.Func(publishContainerID)) + + infoTmpl, err = template.New("info").Funcs(funcMap).Parse(infoTmplSrc) + if err != nil { + return + } + infoNotRunningTmpl, err = template.New("infoNotRunning").Parse(infoNotRunningTmplSrc) + if err != nil { + return + } + infoErrorTmpl, err = template.New("infoError").Parse(infoErrorTmplSrc) + if err != nil { + return + } + }) + + return err +} + +// Info is called when --info flag is enabled when executing the agent binary +func Info(w io.Writer, _ *config.AgentConfig, expvarURL string) error { + var err error + client := http.Client{Timeout: 2 * time.Second} + resp, err := client.Get(expvarURL) + if err != nil { + program, banner := getProgramBanner(options.Version) + _ = infoNotRunningTmpl.Execute(w, struct { + Banner string + Program string + }{ + Banner: banner, + Program: program, + }) + return err + } + defer func() { _ = resp.Body.Close() }() + + var info StatusInfo + if err := json.NewDecoder(resp.Body).Decode(&info); err != nil { + program, banner := getProgramBanner(options.Version) + _ = infoErrorTmpl.Execute(w, struct { + Banner string + Program string + Error error + }{ + Banner: banner, + Program: program, + Error: err, + }) + return err + } + + program, banner := getProgramBanner(info.Version.Version) + err = infoTmpl.Execute(w, struct { + Banner string + Program string + Status *StatusInfo + }{ + Banner: banner, + Program: program, + Status: &info, + }) + if err != nil { + return err + } + return nil +} diff --git a/pkg/config/config.go b/pkg/config/config.go index 9fb9d6a6..a5c91376 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -21,6 +21,7 @@ import ( statsd "github.com/n9e/n9e-agentd/pkg/config/statsd" systemprobe "github.com/n9e/n9e-agentd/pkg/system-probe/config" "github.com/n9e/n9e-agentd/pkg/util" + "github.com/yubo/golib/api/resource" "github.com/yubo/golib/configer" "github.com/yubo/golib/proc" "k8s.io/klog/v2" @@ -105,11 +106,15 @@ type Config struct { //N9eSeriesFormat bool `json:"n9e_series_format" default:"true"` // the payload format for forwarder Endpoints []string `json:"endpoints" flag:"endpoints" default:"http://localhost:8000" env:"N9E_ENDPOINTS" description:"endpoints addresses of n9e server"` // site, dd_url - MetadataProviders []MetadataProviders `json:"metadata_providers"` // metadata_providers - Forwarder forwarder.Config `json:"forwarder"` // fowarder_* - PrometheusScrape PrometheusScrape `json:"prometheus_scrape"` // prometheus_scrape - Autoconfig Autoconfig `json:"autoconfig"` // - Container Container `json:"container"` // + MetadataProviders []MetadataProviders `json:"metadata_providers"` // metadata_providers + Forwarder forwarder.Config `json:"forwarder"` // fowarder_* + PrometheusScrape PrometheusScrape `json:"prometheus_scrape"` // prometheus_scrape + Autoconfig Autoconfig `json:"autoconfig"` // + + Container Container `json:"container"` // + ContainerdNamespace string `json:"containerd_namespace" default:"k8s.io"` // containerd_namespace + ExcludePauseContainer bool `json:"exclude_pause_container"` // exclude_pause_container + SnmpTraps snmp.TrapsConfig `json:"snmp_traps"` // snmp_traps_config SnmpListener snmp.ListenerConfig `json:"snmp_listener"` // snmp_listener ClusterAgent ClusterAgent `json:"cluster_agent"` // cluster_agent @@ -194,10 +199,6 @@ type Config struct { CollectKubernetesEvents bool `json:"collect_kubernetes_events"` // collect_kubernetes_events ComplianceConfigDir string `json:"compliance_config_dir" description:"default {root}/compliance.d"` // compliance_config.dir ComplianceConfigEnabled bool `json:"compliance_config_enabled"` // compliance_config.enabled - ContainerCgroupPrefix string `json:"container_cgroup_prefix"` // container_cgroup_prefix - ContainerCgroupRoot string `json:"container_cgroup_root"` // container_cgroup_root - ContainerProcRoot string `json:"container_proc_root"` // container_proc_root - ContainerdNamespace string `json:"containerd_namespace" default:"k8s.io"` // containerd_namespace CriConnectionTimeout api.Duration `json:"cri_connection_timeout" flag:"cri-connection-timeout" default:"1s" description:"cri connection timeout"` // cri_connection_timeout CriQueryTimeout api.Duration `json:"cri_query_timeout" flag:"cri-query-timeout" default:"5s" description:"cri query timeout"` // cri_query_timeout DatadogCluster bool `json:"datadog_cluster"` // datadog-cluster @@ -216,7 +217,6 @@ type Config struct { ExcludeGCETags []string `json:"exclude_gce_tags" default:"kube-env,kubelet-config,containerd-configure-sh,startup-script,shutdown-script,configure-sh,sshKeys,ssh-keys,user-data,cli-cert,ipsec-cert,ssl-cert,google-container-manifest,boshSettings,windows-startup-script-ps1,common-psm1,k8s-node-setup-psm1,serial-port-logging-enable,enable-oslogin,disable-address-manager,disable-legacy-endpoints,windows-keys,kubeconfig"` // exclude_gce_tags - ExcludePauseContainer bool `json:"exclude_pause_container"` // exclude_pause_container ExternalMetricsAggregator string `json:"external_metrics_aggregator" default:"avg"` // external_metrics.aggregator ExtraListeners []string `json:"extra_listeners"` // extra_listeners FullSketches bool `json:"full_sketches"` // full-sketches @@ -246,7 +246,7 @@ type Config struct { KubernetesKubeletHost string `json:"kubernetes_kubelet_host"` // kubernetes_kubelet_host KubernetesKubeletNodename string `json:"kubernetes_kubelet_nodename"` // kubernetes_kubelet_nodename KubernetesMapServicesOnIp bool `json:"kubernetes_map_services_on_ip"` // kubernetes_map_services_on_ip - KubernetesMetadataTagUpdateFreq_ int `json:"kubernetes_metadata_tag_update_freq" flag:"kubernetes-metadata-tag-update-freq" default:"60" description:"kubernetesMetadataTagUpdateFreq(Second)"` // kubernetes_metadata_tag_update_freq + KubernetesMetadataTagUpdateFreq api.Duration `json:"kubernetes_metadata_tag_update_freq" flag:"kubernetes-metadata-tag-update-freq" default:"60" description:"kubernetesMetadataTagUpdateFreq"` // kubernetes_metadata_tag_update_freq KubernetesNamespaceLabelsAsTags bool `json:"kubernetes_namespace_labels_as_tags"` // kubernetes_namespace_labels_as_tags KubernetesNodeLabelsAsTags bool `json:"kubernetes_node_labels_as_tags"` // kubernetes_node_labels_as_tags KubernetesPodAnnotationsAsTags map[string]string `json:"kubernetes_pod_annotations_as_tags"` // kubernetes_pod_annotations_as_tags @@ -340,6 +340,12 @@ func (p *Config) Get(path string) interface{} { return p.configer.GetRaw("agent." + path) } +func (p *Config) GetString(path string) string { + p.m.RLock() + defer p.m.RUnlock() + return p.configer.GetString("agent." + path) +} + func (p *Config) Set(k string, v interface{}) error { p.m.Lock() defer p.m.Unlock() @@ -483,7 +489,7 @@ func (p *Config) ValidatePath() (err error) { klog.V(1).InfoS("agent", "check_flare_dir", p.CheckFlareDir) p.RuntimeSecurity.PoliciesDir = root.Abs(p.RuntimeSecurity.PoliciesDir, "etc", "runtime-security.d") - p.SystemProbe.SocketAddress = root.Abs(p.SystemProbe.SocketAddress, "run", "sysprobe.sock") + p.SystemProbe.SysprobeSocket = root.Abs(p.SystemProbe.SysprobeSocket, "run", "sysprobe.sock") p.SystemProbe.LogFile = root.Abs(p.SystemProbe.LogFile, "logs", "system-probe.log") p.ComplianceConfigDir = root.Abs(p.ComplianceConfigDir, "compliance.d") p.AutoconfTemplateDir = root.Abs(p.AutoconfTemplateDir, "check_configs") @@ -507,14 +513,20 @@ type UseV2Api struct { } type Container struct { - DockerHost string `json:"-"` - EksFargate bool `json:"eks_fargate"` - CriSocketPath string `json:"cri_socket_path"` - IncludeMetrics []string `json:"include_metrics"` // container_include, container_include_metrics, ac_include - ExcludeMetrics []string `json:"exclude_metrics"` // container_exclude, container_exclude_metrics, ac_exclude - IncludeLogs []string `json:"include_logs"` // container_include_logs - ExcludeLogs []string `json:"exclude_logs"` // container_exclude_logs - ExcludePauseContainer bool `json:"exclude_parse_container"` // exclude_pause_container + DockerHost string `json:"-"` + EksFargate bool `json:"eks_fargate"` + CriSocketPath string `json:"cri_socket_path"` + IncludeMetrics []string `json:"include_metrics"` // container_include, container_include_metrics, ac_include + ExcludeMetrics []string `json:"exclude_metrics"` // container_exclude, container_exclude_metrics, ac_exclude + IncludeLogs []string `json:"include_logs"` // container_include_logs + ExcludeLogs []string `json:"exclude_logs"` // container_exclude_logs + CgroupRoot string `json:"cgroup_root"` // container_cgroup_root + CgroupPrefix string `json:"cgroup_prefix"` // container_cgroup_prefix + ProcRoot string `json:"proc_root"` // container_proc_root + + //ContainerProcRoot string `json:"container_proc_root"` // container_proc_root + //ContainerCgroupPrefix string `json:"container_cgroup_prefix"` // container_cgroup_prefix + //ContainerCgroupRoot string `json:"container_cgroup_root"` // container_cgroup_root } func (p *Container) Validate() error { @@ -522,9 +534,48 @@ func (p *Container) Validate() error { } type ProcessConfig struct { - Enabled bool `json:"enabled"` // process_config.enabled + Enabled bool `json:"enabled" flag:"process-enable" env:"N9E_PROCESS_AGENT_ENABLED" description:"true: collect containers and processes, false: only collect containers, disabled: disabled altogether and won't start"` // process_config.enabled + ProcessCheck bool `json:"process_check" description:"check process & rtprocess"` + OrchestratorAdditionalEndpoints map[string][]string `json:"orchestrator_additional_endpoints"` // process_config.orchestrator_additional_endpoints Url string `json:"url"` // process_config.orchestrator_dd_url + LogFile string `json:"log_file"` // process_config.log_file + + BlacklistPatterns []string `json:"blacklist_patterns"` + ExpvarPort int `json:"expvar_port" default:"6062"` // process_config.expvar_port + ScrubArgs bool `json:"scrub_args" default:"true"` + CustomSensitiveWords []string `json:"custom_sensitive_words"` // custom_sensitive_words + + StripProcArguments bool `json:"strip_proc_arguments"` + + QueueSize int `json:"queue_size" default:"256"` + QueueBytes resource.Quantity `json:"queue_bytes" default:"60M"` // process_queue_bytes + MaxPerMessage int `json:"max_per_message" default:"100"` + MaxCtrProcessesPerMessage int `json:"max_ctr_procs_per_message" default:"10000"` + GrpcConnectionTimeout api.Duration `json:"grpc_connection_timeout" default:"60s"` + + Intervals ProcessIntervals `json:"intervals"` + + Windows ProcessWindows `json:"windows"` + + AdditionalEndpoints map[string][]string `json:"additional_endpoints"` + + InternalProfiling internalprofiling.InternalProfiling `json:"internal_profiling"` // internal_profiling + + ContainerSource []string `json:"container_source"` +} + +type ProcessWindows struct { + ArgsRefreshInterval int `json:"args_refresh_interval" default:"15" description:"Sets windows process table refresh rate (in number of check runs)"` + AddNewArgs bool `json:"add_new_args" default:"true" description:"Controls getting process arguments immediately when a new process is discovered"` +} + +type ProcessIntervals struct { + Container api.Duration `json:"container"` + RTContainer api.Duration `json:"rtcontainer"` + Process api.Duration `json:"process"` + RTProcess api.Duration `json:"rtprocess"` + Connections api.Duration `json:"connections"` } type Experimental struct { @@ -868,56 +919,6 @@ type Warnings struct { TraceMallocEnabledWithPy2 bool } -// GetMultipleEndpoints returns the api keys per domain specified in the main agent config -func GetMultipleEndpoints() (map[string][]string, error) { - return getMultipleEndpointsWithConfig(C) -} - -// getMultipleEndpointsWithConfig implements the logic to extract the api keys per domain from an agent config -func getMultipleEndpointsWithConfig(config *Config) (map[string][]string, error) { - endpoints := strings.Join(config.Endpoints, ",") - - keysPerDomain := map[string][]string{ - endpoints: {config.ApiKey}, - } - - additionalEndpoints := config.Forwarder.AdditionalEndpoints - // merge additional endpoints into keysPerDomain - for _, addition := range additionalEndpoints { - endpoints := strings.Join(addition.Endpoints, ",") - - if _, ok := keysPerDomain[endpoints]; ok { - for _, apiKey := range addition.ApiKeys { - keysPerDomain[endpoints] = append(keysPerDomain[endpoints], apiKey) - } - } else { - keysPerDomain[endpoints] = addition.ApiKeys - } - } - - // dedupe api keys and remove domains with no api keys (or empty ones) - // for endpoints, apiKeys := range keysPerDomain { - // dedupedAPIKeys := make([]string, 0, len(apiKeys)) - // seen := make(map[string]bool) - // for _, apiKey := range apiKeys { - // trimmedAPIKey := strings.TrimSpace(apiKey) - // if _, ok := seen[trimmedAPIKey]; !ok && trimmedAPIKey != "" { - // seen[trimmedAPIKey] = true - // dedupedAPIKeys = append(dedupedAPIKeys, trimmedAPIKey) - // } - // } - - // if len(dedupedAPIKeys) > 0 { - // keysPerDomain[endpoints] = dedupedAPIKeys - // } else { - // klog.Infof("No API key provided for domain \"%s\", removing domain from endpoints", endpoints) - // delete(keysPerDomain, endpoints) - // } - // } - - return keysPerDomain, nil -} - func NewConfig(configer *configer.Configer) (*Config, error) { cf := &Config{ m: new(sync.RWMutex), @@ -933,7 +934,7 @@ func NewConfig(configer *configer.Configer) (*Config, error) { // Fallback to the container paths if host paths aren't mounted. if pathExists("/host/proc") { cf.ProcfsPath = "/host/proc" - cf.ContainerProcRoot = "/host/proc" + cf.Container.ProcRoot = "/host/proc" // Used by some librairies (like gopsutil) if v := os.Getenv("HOST_PROC"); v == "" { @@ -941,23 +942,22 @@ func NewConfig(configer *configer.Configer) (*Config, error) { } } else { cf.ProcfsPath = "/proc" - cf.ContainerProcRoot = "/proc" + cf.Container.ProcRoot = "/proc" } if pathExists("/host/sys/fs/cgroup/") { - cf.ContainerCgroupRoot = "/host/sys/fs/cgroup/" + cf.Container.CgroupRoot = "/host/sys/fs/cgroup/" } else { - cf.ContainerCgroupRoot = "/sys/fs/cgroup/" + cf.Container.CgroupRoot = "/sys/fs/cgroup/" } } else { - cf.ContainerProcRoot = "/proc" + cf.Container.ProcRoot = "/proc" // for amazon linux the cgroup directory on host is /cgroup/ // we pick memory.stat to make sure it exists and not empty if _, err := os.Stat("/cgroup/memory/memory.stat"); !os.IsNotExist(err) { - cf.ContainerCgroupRoot = "/cgroup/" + cf.Container.CgroupRoot = "/cgroup/" } else { - cf.ContainerCgroupRoot = "/sys/fs/cgroup/" + cf.Container.CgroupRoot = "/sys/fs/cgroup/" } - } cf.Statsd.MetricNamespaceBlacklist = StandardStatsdPrefixes diff --git a/pkg/config/default.go b/pkg/config/default.go index f02ac226..4e740dc2 100644 --- a/pkg/config/default.go +++ b/pkg/config/default.go @@ -8,8 +8,8 @@ const ( //authTokenName = "auth_token" // DefaultSite is the default site the Agent sends data to. - //DefaultSite = "datadoghq.com" - //infraURLPrefix = "https://app." + DefaultSite = "datadoghq.com" + infraURLPrefix = "https://app." // DefaultNumWorkers default number of workers for our check runner DefaultNumWorkers = 4 diff --git a/pkg/config/util.go b/pkg/config/util.go index 2c5fc6a6..7d8dddf8 100644 --- a/pkg/config/util.go +++ b/pkg/config/util.go @@ -205,6 +205,56 @@ func GetMainEndpoint() (host string) { return } +// GetMultipleEndpoints returns the api keys per domain specified in the main agent config +func GetMultipleEndpoints() (map[string][]string, error) { + return getMultipleEndpointsWithConfig(C) +} + +// getMultipleEndpointsWithConfig implements the logic to extract the api keys per domain from an agent config +func getMultipleEndpointsWithConfig(config *Config) (map[string][]string, error) { + endpoints := strings.Join(config.Endpoints, ",") + + keysPerDomain := map[string][]string{ + endpoints: {config.ApiKey}, + } + + additionalEndpoints := config.Forwarder.AdditionalEndpoints + // merge additional endpoints into keysPerDomain + for _, addition := range additionalEndpoints { + endpoints := strings.Join(addition.Endpoints, ",") + + if _, ok := keysPerDomain[endpoints]; ok { + for _, apiKey := range addition.ApiKeys { + keysPerDomain[endpoints] = append(keysPerDomain[endpoints], apiKey) + } + } else { + keysPerDomain[endpoints] = addition.ApiKeys + } + } + + // dedupe api keys and remove domains with no api keys (or empty ones) + // for endpoints, apiKeys := range keysPerDomain { + // dedupedAPIKeys := make([]string, 0, len(apiKeys)) + // seen := make(map[string]bool) + // for _, apiKey := range apiKeys { + // trimmedAPIKey := strings.TrimSpace(apiKey) + // if _, ok := seen[trimmedAPIKey]; !ok && trimmedAPIKey != "" { + // seen[trimmedAPIKey] = true + // dedupedAPIKeys = append(dedupedAPIKeys, trimmedAPIKey) + // } + // } + + // if len(dedupedAPIKeys) > 0 { + // keysPerDomain[endpoints] = dedupedAPIKeys + // } else { + // klog.Infof("No API key provided for domain \"%s\", removing domain from endpoints", endpoints) + // delete(keysPerDomain, endpoints) + // } + // } + + return keysPerDomain, nil +} + // GetValidHostAliases validates host aliases set in `host_aliases` variable and returns // only valid ones. func GetValidHostAliases() []string { diff --git a/pkg/options/build.go b/pkg/options/build.go index d66d9a6f..ccc302ef 100644 --- a/pkg/options/build.go +++ b/pkg/options/build.go @@ -60,8 +60,8 @@ var ( // set to a non-empty string, we log the build information at process startup. LogBuildInfoAtStartup string - // goVersion is the current runtime version. - goVersion = runtime.Version() + // GoVersion is the current runtime version. + GoVersion = runtime.Version() goOs = runtime.GOOS goArch = runtime.GOARCH @@ -77,7 +77,7 @@ var ( // LogBuildInfo logs the build information to the provided logger. func LogBuildInfo() { - klog.Infof("Go Runtime version: %s\n", goVersion) + klog.Infof("Go Runtime version: %s\n", GoVersion) klog.Infof("OS: %s\n", goOs) klog.Infof("Arch: %s\n", goArch) klog.Infof("Build Version: %s\n", Version) @@ -128,8 +128,8 @@ func (b *buildReporter) Start() error { } func (b *buildReporter) _report() { - b.buildInfoGauge.Set(1.0, Revision, Branch, BuildDate, Version, goVersion) - b.buildAgeGauge.Set(float64(time.Since(b.buildTime)), Revision, Branch, BuildDate, Version, goVersion) + b.buildInfoGauge.Set(1.0, Revision, Branch, BuildDate, Version, GoVersion) + b.buildAgeGauge.Set(float64(time.Since(b.buildTime)), Revision, Branch, BuildDate, Version, GoVersion) } func (b *buildReporter) report() { @@ -194,7 +194,7 @@ func NewVersionCmd() *cobra.Command { } func VersionCmd(cmd *cobra.Command, args []string) error { - fmt.Printf("Go Runtime version: %s\n", goVersion) + fmt.Printf("Go Runtime version: %s\n", GoVersion) fmt.Printf("OS: %s\n", goOs) fmt.Printf("Arch: %s\n", goArch) fmt.Printf("Build Version: %s\n", Version) diff --git a/pkg/system-probe/config/config.go b/pkg/system-probe/config/config.go index 5ce11560..12881d76 100644 --- a/pkg/system-probe/config/config.go +++ b/pkg/system-probe/config/config.go @@ -1,9 +1,8 @@ package config import ( - "time" - "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/n9e/n9e-agentd/pkg/api" ) // ModuleName is a typed alias for string, used only for module names @@ -32,39 +31,38 @@ type Config struct { // When the system-probe is enabled in a separate container, we need a way to also disable the system-probe // packaged in the main agent container (without disabling network collection on the process-agent). ExternalSystemProbe bool `json:"external" default:"false" env:"DD_SYSTEM_PROBE_EXTERNAL"` // external - SocketAddress string `json:"sysprobe_socket" env:"DD_SYSPROBE_SOCKET" description:"default {root}/run/sysprobe.sock"` // sysprobe_socket - MaxConnsPerMessage int `json:"max_conns_per_message" default:"600"` // max_conns_per_message - LogFile string `json:"log_file" description:"default {root}/logs/system-probe.log"` // log_file - LogLevel string `json:"log_level" default:"info" env:"DD_LOG_LEVEL"` // log_level - DebugPort int `json:"debug_port" default:"0"` // debug_port - StatsdHost string `json:"-" default:"127.0.0.1"` // GetBindHost() - StatsdPort int `json:"dogstatsd_port" default:"8125"` // dogstatsd_port + SysprobeSocket string `json:"sysprobe_socket" env:"DD_SYSPROBE_SOCKET" description:"default {root}/run/sysprobe.sock"` // sysprobe_socket + //SysprobeSocket string `json:"sysprobe_socket"` // system_probe_config.sysprobe_socket + MaxConnsPerMessage int `json:"max_conns_per_message" default:"600"` // max_conns_per_message + LogFile string `json:"log_file" description:"default {root}/logs/system-probe.log"` // log_file + LogLevel string `json:"log_level" default:"info" env:"DD_LOG_LEVEL"` // log_level + DebugPort int `json:"debug_port" default:"0"` // debug_port + StatsdHost string `json:"-" default:"127.0.0.1"` // GetBindHost() + StatsdPort int `json:"dogstatsd_port" default:"8125"` // dogstatsd_port - SysprobeSocket string `json:"sysprobe_socket"` // system_probe_config.sysprobe_socket - BPFDebug bool `json:"bpf_debug"` // system_probe_config.bpf_debug - BPFDir string `json:"bpf_dir"` // system_probe_config.bpf_dir - ExcludedLinuxVersions []string `json:"excluded_linux_versions"` // system_probe_config.excluded_linux_versions - EnableTracepoints bool `json:"enable_tracepoints"` // system_probe_config.enable_tracepoints - EnableRuntimeCompiler bool `json:"enable_runtime_compiler"` // system_probe_config.enable_runtime_compiler - RuntimeCompilerOutputDir string `json:"runtime_compiler_output_dir"` // system_probe_config.runtime_compiler_output_dir - KernelHeaderDirs []string `json:"kernel_header_dirs"` // system_probe_config.kernel_header_dirs - DisableTcp bool `json:"disable_tcp"` // system_probe_config.disable_tcp - DisableUdp bool `json:"disable_udp"` // system_probe_config.disable_udp - DisableIpv6 bool `json:"disable_ipv6"` // system_probe_config.disable_ipv6 - OffsetGuessThreshold int64 `json:"offset_guess_threshold"` // system_probe_config.offset_guess_threshold - SourceExcludes map[string][]string `json:"source_excludes"` // system_probe_config.source_excludes - DestExcludes map[string][]string `json:"dest_excludes"` // system_probe_config.dest_excludes - MaxTrackedConnections int `json:"max_tracked_connections"` // system_probe_config.max_tracked_connections - MaxClosedConnectionsBuffered int `json:"max_closed_connections_buffered"` // system_probe_config.max_closed_connections_buffered - ClosedChannelSize int `json:"closed_channel_size"` // system_probe_config.closed_channel_size - MaxConnectionStateBuffered int `json:"max_connection_state_buffered"` // system_probe_config.max_connection_state_buffered - DisableDnsInspection bool `json:"disable_dns_inspection"` // system_probe_config.disable_dns_inspection - CollectDnsStats bool `json:"collect_dns_stats"` // system_probe_config.collect_dns_stats - CollectLocalDns bool `json:"collect_local_dns"` // system_probe_config.collect_local_dns - CollectDnsDomains bool `json:"collect_dns_domains"` // system_probe_config.collect_dns_domains - MaxDnsStats int `json:"max_dns_stats"` // system_probe_config.max_dns_stats - DnsTimeout time.Duration `json:"-"` - DnsTimeout_ int `json:"dns_timeout" flag:"system-probe-dns-timeout" default:"15" description:"dnsTimeout(Second)"` // system_probe_config.dns_timeout_in_s + BPFDebug bool `json:"bpf_debug"` // system_probe_config.bpf_debug + BPFDir string `json:"bpf_dir"` // system_probe_config.bpf_dir + ExcludedLinuxVersions []string `json:"excluded_linux_versions"` // system_probe_config.excluded_linux_versions + EnableTracepoints bool `json:"enable_tracepoints"` // system_probe_config.enable_tracepoints + EnableRuntimeCompiler bool `json:"enable_runtime_compiler"` // system_probe_config.enable_runtime_compiler + RuntimeCompilerOutputDir string `json:"runtime_compiler_output_dir"` // system_probe_config.runtime_compiler_output_dir + KernelHeaderDirs []string `json:"kernel_header_dirs"` // system_probe_config.kernel_header_dirs + DisableTcp bool `json:"disable_tcp"` // system_probe_config.disable_tcp + DisableUdp bool `json:"disable_udp"` // system_probe_config.disable_udp + DisableIpv6 bool `json:"disable_ipv6"` // system_probe_config.disable_ipv6 + OffsetGuessThreshold int64 `json:"offset_guess_threshold"` // system_probe_config.offset_guess_threshold + SourceExcludes map[string][]string `json:"source_excludes"` // system_probe_config.source_excludes + DestExcludes map[string][]string `json:"dest_excludes"` // system_probe_config.dest_excludes + MaxTrackedConnections int `json:"max_tracked_connections"` // system_probe_config.max_tracked_connections + MaxClosedConnectionsBuffered int `json:"max_closed_connections_buffered"` // system_probe_config.max_closed_connections_buffered + ClosedChannelSize int `json:"closed_channel_size"` // system_probe_config.closed_channel_size + MaxConnectionStateBuffered int `json:"max_connection_state_buffered"` // system_probe_config.max_connection_state_buffered + DisableDnsInspection bool `json:"disable_dns_inspection"` // system_probe_config.disable_dns_inspection + CollectDnsStats bool `json:"collect_dns_stats"` // system_probe_config.collect_dns_stats + CollectLocalDns bool `json:"collect_local_dns"` // system_probe_config.collect_local_dns + CollectDnsDomains bool `json:"collect_dns_domains"` // system_probe_config.collect_dns_domains + MaxDnsStats int `json:"max_dns_stats"` // system_probe_config.max_dns_stats + DnsTimeout api.Duration `json:"dns_timeout" flag:"system-probe-dns-timeout" default:"15" description:"dnsTimeout(Second)"` // system_probe_config.dns_timeout_in_s EnableConntrack bool `json:"enable_conntrack"` // system_probe_config.enable_conntrack ConntrackMaxStateSize int `json:"conntrack_max_state_size"` // system_probe_config.conntrack_max_state_size ConntrackRateLimit int `json:"conntrack_rate_limit"` // system_probe_config.conntrack_rate_limit @@ -75,8 +73,6 @@ type Config struct { } func (p *Config) Validate() error { - p.DnsTimeout = time.Second * time.Duration(p.DnsTimeout_) - if p.MaxConnsPerMessage > maxConnsMessageBatchSize { log.Warn("Overriding the configured connections count per message limit because it exceeds maximum") p.MaxConnsPerMessage = defaultConnsMessageBatchSize diff --git a/staging/datadog-agent/go.mod b/staging/datadog-agent/go.mod index d4c84eec..b15ebb7d 100644 --- a/staging/datadog-agent/go.mod +++ b/staging/datadog-agent/go.mod @@ -35,19 +35,8 @@ replace ( require ( code.cloudfoundry.org/bbs v0.0.0-20200403215808-d7bc971db0db - code.cloudfoundry.org/cfhttp/v2 v2.0.0 // indirect - code.cloudfoundry.org/clock v1.0.0 // indirect - code.cloudfoundry.org/consuladapter v0.0.0-20200131002136-ac1daf48ba97 // indirect - code.cloudfoundry.org/diego-logging-client v0.0.0-20200130234554-60ef08820a45 // indirect - code.cloudfoundry.org/executor v0.0.0-20200218194701-024d0bdd52d4 // indirect code.cloudfoundry.org/garden v0.0.0-20210208153517-580cadd489d2 - code.cloudfoundry.org/go-diodes v0.0.0-20190809170250-f77fb823c7ee // indirect - code.cloudfoundry.org/go-loggregator v7.4.0+incompatible // indirect code.cloudfoundry.org/lager v2.0.0+incompatible - code.cloudfoundry.org/locket v0.0.0-20200131001124-67fd0a0fdf2d // indirect - code.cloudfoundry.org/rep v0.0.0-20200325195957-1404b978e31e // indirect - code.cloudfoundry.org/rfc5424 v0.0.0-20180905210152-236a6d29298a // indirect - code.cloudfoundry.org/tlsconfig v0.0.0-20200131000646-bbe0f8da39b3 // indirect github.com/DataDog/datadog-agent/pkg/util/log v0.30.0-rc.7 github.com/DataDog/datadog-agent/pkg/util/winutil v0.30.0-rc.7 github.com/DataDog/datadog-go v4.8.0+incompatible @@ -61,14 +50,11 @@ require ( github.com/DataDog/watermarkpodautoscaler v0.2.1-0.20210323121426-cfb2caa5613f github.com/DataDog/zstd v1.4.8 github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f - github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver v1.5.0 github.com/Masterminds/sprig v2.22.0+incompatible - github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3 - github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect + github.com/Microsoft/go-winio v0.4.17 github.com/alecthomas/participle v0.7.1 github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 - github.com/andybalholm/brotli v1.0.1 // indirect github.com/avast/retry-go v2.7.0+incompatible github.com/aws/aws-sdk-go v1.35.24 github.com/beevik/ntp v0.3.0 @@ -80,10 +66,9 @@ require ( github.com/clbanning/mxj v1.8.4 github.com/cloudfoundry-community/go-cfclient v0.0.0-20201123235753-4f46d6348a05 github.com/cobaugh/osrelease v0.0.0-20181218015638-a93a0a55a249 - github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68 - github.com/containerd/containerd v1.5.0-beta.4 + github.com/containerd/cgroups v1.0.1 + github.com/containerd/containerd v1.5.5 github.com/containerd/typeurl v1.0.2 - github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf github.com/davecgh/go-spew v1.1.1 github.com/dgraph-io/ristretto v0.0.3 @@ -95,58 +80,42 @@ require ( github.com/fatih/structtag v1.2.0 github.com/florianl/go-conntrack v0.1.1-0.20191002182014-06743d3a59db github.com/freddierice/go-losetup v0.0.0-20170407175016-fc9adea44124 - github.com/go-ini/ini v1.62.0 github.com/go-ole/go-ole v1.2.5 github.com/go-openapi/spec v0.20.3 - github.com/go-sql-driver/mysql v1.5.0 // indirect - github.com/go-test/deep v1.0.5 // indirect github.com/gobwas/glob v0.2.3 github.com/godbus/dbus v4.1.0+incompatible github.com/gogo/protobuf v1.3.2 github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 - github.com/golang/snappy v0.0.3 // indirect github.com/google/gofuzz v1.2.0 github.com/google/gopacket v1.1.19 github.com/google/pprof v0.0.0-20210125172800-10e9aeb4a998 github.com/gorilla/mux v1.8.0 github.com/gosnmp/gosnmp v1.32.0 - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/h2non/filetype v1.1.2-0.20210602110014-3305bbb7ac7b github.com/hashicorp/consul/api v1.8.1 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/golang-lru v0.5.4 github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 - github.com/huandu/xstrings v1.3.2 // indirect - github.com/ianlancetaylor/cgosymbolizer v0.0.0-20201204192058-7acc97e53614 // indirect github.com/iceber/iouring-go v0.0.0-20210726032807-b073cc83b2b8 github.com/iovisor/gobpf v0.0.0 github.com/itchyny/gojq v0.12.4 github.com/json-iterator/go v1.1.11 github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 - github.com/klauspost/compress v1.11.12 // indirect - github.com/klauspost/pgzip v1.2.5 // indirect github.com/kubernetes-sigs/custom-metrics-apiserver v0.0.0-20210311094424-0ca2b1909cdc - github.com/lib/pq v1.10.0 // indirect - github.com/lxn/walk v0.0.0-20191128110447-55ccb3a9f5c1 // indirect - github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4 // indirect github.com/mailru/easyjson v0.7.7 github.com/mdlayher/netlink v1.4.1 github.com/mholt/archiver/v3 v3.5.0 github.com/miekg/dns v1.1.43 - github.com/mitchellh/copystructure v1.1.2 // indirect github.com/mitchellh/mapstructure v1.4.1 github.com/moby/sys/mountinfo v0.4.1 - github.com/n9e/agent-payload v0.0.0-20210803052830-38cc6d91cc21 // indirect - github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 // indirect - github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d + github.com/n9e/agent-payload v0.0.0-20210803052830-38cc6d91cc21 + github.com/n9e/n9e-agentd v0.0.0-00010101000000-000000000000 + github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 github.com/openshift/api v0.0.0-20190924102528-32369d4db2ad github.com/patrickmn/go-cache v2.1.0+incompatible - github.com/pierrec/lz4/v4 v4.1.3 // indirect github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.10.0 github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da @@ -154,30 +123,22 @@ require ( github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 github.com/shuLhan/go-bindata v3.6.1+incompatible github.com/spf13/afero v1.6.0 - github.com/spf13/cobra v1.1.3 // indirect - github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.7.0 github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 - github.com/tedsuo/ifrit v0.0.0-20191009134036-9a97d0632f00 // indirect github.com/tinylib/msgp v1.1.6 - github.com/tklauser/go-sysconf v0.3.4 // indirect github.com/twmb/murmur3 v1.1.5 - github.com/ulikunitz/xz v0.5.10 // indirect - github.com/urfave/negroni v1.0.0 // indirect github.com/vishvananda/netlink v1.1.1-0.20210508154835-66ddd91f7ddd github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f - github.com/vito/go-sse v1.0.0 // indirect github.com/vmihailenco/msgpack/v4 v4.3.11 github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f + github.com/yubo/apiserver v0.0.0-20210918082128-653f7fb53aa9 go.etcd.io/etcd/client/v2 v2.305.0 - go.opencensus.io v0.22.6 // indirect go.opentelemetry.io/otel v0.20.0 go.uber.org/automaxprocs v1.4.0 - golang.org/x/crypto v0.0.0-20210317152858-513c2a44f670 // indirect golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f - golang.org/x/net v0.0.0-20210525063256-abc453219eb5 + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20210601080250-7ecdf8ef093b + golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71 golang.org/x/text v0.3.6 golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba golang.org/x/tools v0.1.4 @@ -185,23 +146,22 @@ require ( google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c google.golang.org/grpc v1.38.0 gopkg.in/DataDog/dd-trace-go.v1 v1.31.1 - gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect - gopkg.in/ini.v1 v1.55.0 // indirect gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b gopkg.in/zorkian/go-datadog-api.v2 v2.30.0 gotest.tools v2.2.0+incompatible - k8s.io/api v0.21.1 - k8s.io/apimachinery v0.21.3 - k8s.io/apiserver v0.20.5 // indirect + k8s.io/api v0.22.0 + k8s.io/apimachinery v0.22.2 k8s.io/autoscaler/vertical-pod-autoscaler v0.9.2 k8s.io/client-go v12.0.0+incompatible - k8s.io/cri-api v0.20.1 + k8s.io/cri-api v0.20.6 k8s.io/klog v1.0.1-0.20200310124935-4ad0115ba9e4 // Min version that includes fix for Windows Nano + k8s.io/klog/v2 v2.9.0 k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 k8s.io/kube-state-metrics/v2 v2.0.1-0.20210419063836-dfab196f138a k8s.io/kubernetes v1.20.5 k8s.io/metrics v0.20.5 + sigs.k8s.io/yaml v1.2.0 ) // Pinned to kubernetes-v0.20.5 diff --git a/staging/datadog-agent/go.sum b/staging/datadog-agent/go.sum index 592819e5..54ecb01b 100644 --- a/staging/datadog-agent/go.sum +++ b/staging/datadog-agent/go.sum @@ -47,28 +47,33 @@ code.cloudfoundry.org/clock v1.0.0 h1:kFXWQM4bxYvdBw2X8BbBeXwQNgfoWv1vqAk2ZZyBN2 code.cloudfoundry.org/clock v1.0.0/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8= code.cloudfoundry.org/consuladapter v0.0.0-20200131002136-ac1daf48ba97 h1:ESnk2S/BMpu3ndjQRSMvwKFFkF25GTQvGRSSHQy0Wdw= code.cloudfoundry.org/consuladapter v0.0.0-20200131002136-ac1daf48ba97/go.mod h1:bOVcKUGVpa9/23DMPJUd4mPt420blgr/Tpwb0+y32Cc= -code.cloudfoundry.org/diego-logging-client v0.0.0-20200130234554-60ef08820a45 h1:WtR6lLAuZsSekDsCsup0UlzWeZLQ2k3QHaUvd7Zn3Io= code.cloudfoundry.org/diego-logging-client v0.0.0-20200130234554-60ef08820a45/go.mod h1:L8Y+60YwdebCsAE6US++EVqddijkVMMC4Ucx0nPH03o= +code.cloudfoundry.org/diego-logging-client v0.0.0-20210622170659-8861ae5ba2ed h1:Qh2HydgreIaleNEELfIfFdwZm0g6S21Qbciz8Y1A+WA= +code.cloudfoundry.org/diego-logging-client v0.0.0-20210622170659-8861ae5ba2ed/go.mod h1:x///zILDLKzCz2SauYWxzoiEumjnvpDEZg0FZFYIj1g= code.cloudfoundry.org/executor v0.0.0-20200218194701-024d0bdd52d4 h1:7Xt9CK85rIiYmkC0mnP1rmD3JWExDFRiVYjLED+NBPw= code.cloudfoundry.org/executor v0.0.0-20200218194701-024d0bdd52d4/go.mod h1:oemBimQzPedAfYleiBj968jpfEkSw8F5OsP+zYkVMRk= code.cloudfoundry.org/garden v0.0.0-20210208153517-580cadd489d2 h1:yuiaehHdBGsP2YVma86r25a9ycRw0Pbmy2GjZ5Dk35w= code.cloudfoundry.org/garden v0.0.0-20210208153517-580cadd489d2/go.mod h1:Z9w+yiu8NUNM7ZXBsveh4wcsjZdkICVuNZkF1CqLi2E= +code.cloudfoundry.org/go-diodes v0.0.0-20180905200951-72629b5276e3/go.mod h1:Jzi+ccHgo/V/PLQUaQ6hnZcC1c4BS790gx21LRRui4g= code.cloudfoundry.org/go-diodes v0.0.0-20190809170250-f77fb823c7ee h1:iAAPf9s7/+BIiGf+RjgcXLm3NoZaLIJsBXJuUa63Lx8= code.cloudfoundry.org/go-diodes v0.0.0-20190809170250-f77fb823c7ee/go.mod h1:Jzi+ccHgo/V/PLQUaQ6hnZcC1c4BS790gx21LRRui4g= code.cloudfoundry.org/go-loggregator v7.4.0+incompatible h1:KqZYloMQWM5Zg/BQKunOIA4OODh7djZbk48qqbowNFI= code.cloudfoundry.org/go-loggregator v7.4.0+incompatible/go.mod h1:KPBTRqj+y738Nhf1+g4JHFaBU8j7dedirR5ETNHvMXU= +code.cloudfoundry.org/go-loggregator/v8 v8.0.5 h1:p1rrGxTwUqLjlUVtbjTAvKOSGNmPuBja8LeQOQgRrBc= +code.cloudfoundry.org/go-loggregator/v8 v8.0.5/go.mod h1:mLlJ1ZyG6gVvBEtYypvbztRvFeCtBsTxE9tt+85tS6Y= code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f h1:UrKzEwTgeiff9vxdrfdqxibzpWjxLnuXDI5m6z3GJAk= code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f/go.mod h1:sk5LnIjB/nIEU7yP5sDQExVm62wu0pBh3yrElngUisI= code.cloudfoundry.org/lager v2.0.0+incompatible h1:WZwDKDB2PLd/oL+USK4b4aEjUymIej9My2nUQ9oWEwQ= code.cloudfoundry.org/lager v2.0.0+incompatible/go.mod h1:O2sS7gKP3HM2iemG+EnwvyNQK7pTSC6Foi4QiMp9sSk= -code.cloudfoundry.org/locket v0.0.0-20200131001124-67fd0a0fdf2d h1:4a9j7UW7yfC57sgUI0ZIJRZDl4Jzopm1LjEa/r5v36I= code.cloudfoundry.org/locket v0.0.0-20200131001124-67fd0a0fdf2d/go.mod h1:AwHLRkdXtttLXNB8RHgLfErJ2kKafH62AR2OClhy6xI= +code.cloudfoundry.org/locket v0.0.0-20210706150026-b8ae29a4de0f h1:ml2FnGX8fNx2MYNoYFycbKjSrp1Cd51tH6BXD/Mubkw= +code.cloudfoundry.org/locket v0.0.0-20210706150026-b8ae29a4de0f/go.mod h1:AwHLRkdXtttLXNB8RHgLfErJ2kKafH62AR2OClhy6xI= code.cloudfoundry.org/rep v0.0.0-20200325195957-1404b978e31e h1:vOdVK7gb0N0XyhLaZNqY+Zcia577jhNBpxzbxFqYof0= code.cloudfoundry.org/rep v0.0.0-20200325195957-1404b978e31e/go.mod h1:Z5Ez6B/8Ec6h2ybwrzEfHOZSSPvlIGO3TmL4mMzOwFg= -code.cloudfoundry.org/rfc5424 v0.0.0-20180905210152-236a6d29298a h1:8rqv2w8xEceNwckcF5ONeRt0qBHlh5bnNfFnYTrZbxs= code.cloudfoundry.org/rfc5424 v0.0.0-20180905210152-236a6d29298a/go.mod h1:tkZo8GtzBjySJ7USvxm4E36lNQw1D3xM6oKHGqdaAJ4= -code.cloudfoundry.org/tlsconfig v0.0.0-20200131000646-bbe0f8da39b3 h1:2Qal+q+tw/DmDOoJBWwDCPE3lIJNj/1o7oMkkb2c5SI= code.cloudfoundry.org/tlsconfig v0.0.0-20200131000646-bbe0f8da39b3/go.mod h1:eTbFJpyXRGuFVyg5+oaj9B2eIbIc+0/kZjH8ftbtdew= +code.cloudfoundry.org/tlsconfig v0.0.0-20210615191307-5d92ef3894a7 h1:5N6M1WbWH3bknkX80Q/s7eEo5odqjixLAW79Zrrbqu0= +code.cloudfoundry.org/tlsconfig v0.0.0-20210615191307-5d92ef3894a7/go.mod h1:CKI5CV+3MlfcohVSuU3FxXubFyC52lYJGMLnZ2ltvks= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AlekSi/pointer v1.0.0/go.mod h1:1kjywbfcPFCmncIxtk6fIEub6LKrfMz3gc5QKVOSOA8= github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= @@ -94,11 +99,9 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/agent-payload v4.78.0+incompatible h1:K1ViQVfIAEaSEBLug087JkcnVP+NKxKU4nQ1OucCglU= github.com/DataDog/agent-payload v4.78.0+incompatible/go.mod h1:/2RW4IC/2z54jtB6RLgq5UtVI1TsX0joDRjKbkLT+mk= github.com/DataDog/cast v1.3.1-0.20190301154711-1ee8c8bd14a3 h1:SobA9WYm4K/MUtWlbKaomWTmnuYp1KhIm8Wlx3vmpsg= github.com/DataDog/cast v1.3.1-0.20190301154711-1ee8c8bd14a3/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/DataDog/datadog-agent v0.0.0-20210730134932-2365d4a4f838/go.mod h1:W6eTPOO+eweRBoTGR6SNF7Fi/x0qUbQ6Mpr7+oxRRH0= github.com/DataDog/datadog-api-client-go v1.0.0-beta.18/go.mod h1:Gn0fZwIOBbSidO0OaPEh9nO5EmIPsxJrHfHvfVXEaoU= github.com/DataDog/datadog-go v4.4.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.8.0+incompatible h1:vjzonG+3XzZgYrumNmdrA4QpXju/ZXrwb0mRjpYYbuo= @@ -117,8 +120,8 @@ github.com/DataDog/gopsutil v0.0.0-20200624212600-1b53412ef321 h1:OPAXA+r6yznoxW github.com/DataDog/gopsutil v0.0.0-20200624212600-1b53412ef321/go.mod h1:tGQp6XG4XpOyy67WG/YWXVxzOY6LejK35e8KcQhtRIQ= github.com/DataDog/gostackparse v0.5.0 h1:jb72P6GFHPHz2W0onsN51cS3FkaMDcjb0QzgxxA4gDk= github.com/DataDog/gostackparse v0.5.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM= -github.com/DataDog/mmh3 v0.0.0-20200316233529-f5b682d8c981 h1:UcKqIrOowv2PjTkOC27Xm9TMZlPbRi3CK1OCoawdvl0= github.com/DataDog/mmh3 v0.0.0-20200316233529-f5b682d8c981/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= +github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a h1:m9REhmyaWD5YJ0P53ygRHxKKo+KM+nw+zz0hEdKztMo= github.com/DataDog/mmh3 v0.0.0-20200805151601-30884ca2197a/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= github.com/DataDog/nikos v1.0.0 h1:rpZRYzsT8sCOGmYCOuFGIW9TEQJ4zGEz1UPi7J3wUz8= github.com/DataDog/nikos v1.0.0/go.mod h1:m4dT3ncRR/jXiTdwg4GLK8gGJdGJILin+3A4paL8Rxg= @@ -128,6 +131,7 @@ github.com/DataDog/viper v1.9.0 h1:9Ha1yJebecIKtboH/GXUM3brfoMofvdd8BlMck8Cs8Q= github.com/DataDog/viper v1.9.0/go.mod h1:Gx7+/WONkbQIh3ac52KqcFTzipQ1OYHhCQGWAgHlzpc= github.com/DataDog/watermarkpodautoscaler v0.2.1-0.20210323121426-cfb2caa5613f h1:MESPSq9d/7I0plUd8M4e4jD8DQ/aMA2sc634hZAsKGQ= github.com/DataDog/watermarkpodautoscaler v0.2.1-0.20210323121426-cfb2caa5613f/go.mod h1:9noQqDYq4AoJ+e10Z2jwmQ+bOaewjujW4gVwY2/P+Vc= +github.com/DataDog/zstd v1.4.8 h1:Rpmta4xZ/MgZnriKNd24iZMhGpP5dvUcs/uqfBapKZY= github.com/DataDog/zstd v1.4.8/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f h1:5Vuo4niPKFkfwW55jV4vY0ih3VQ9RaQqeqY67fvRn8A= github.com/DataDog/zstd_0 v0.0.0-20210310093942-586c1286621f/go.mod h1:oXfOhM/Kr8OvqS6tVqJwxPBornV0yrx3bc+l0BDr7PQ= @@ -211,6 +215,7 @@ github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9Pq github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apoydence/eachers v0.0.0-20181020210610-23942921fe77/go.mod h1:bXvGk6IkT1Agy7qzJ+DjIw/SJ1AaB3AvAuMDVV+Vkoo= github.com/arduino/go-apt-client v0.0.0-20190812130613-5613f843fdc8 h1:HpmeqWCUoU+dPrz8V4KGDMDxvR+WyeJ0g6DSSqnptuY= github.com/arduino/go-apt-client v0.0.0-20190812130613-5613f843fdc8/go.mod h1:U1gYCDLM1Kg0dG0PxUjlT09+l6/TdUZKx0FQ2CocJUU= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -261,6 +266,7 @@ github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+Wji github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/brancz/gojsontoyaml v0.0.0-20190425155809-e8bd32d46b3d/go.mod h1:IyUJYN1gvWjtLF5ZuygmxbnsAyP3aJS6cHzIuZY50B0= github.com/brancz/gojsontoyaml v0.0.0-20201216083616-202f76bf8c1f/go.mod h1:eiVwwkJ9JtehmGNiFz03FXpw889jH63XGuhIeug3u4s= +github.com/buger/goterm v1.0.1 h1:kSgw3jcjYUzC0Uh/eG8ULjccuz353solup27lUH8Zug= github.com/buger/goterm v1.0.1/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE= github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/caddyserver/caddy v1.0.3/go.mod h1:G+ouvOY32gENkJC+jhgl62TyhvqEsFaDiZ4uw0RzP1E= @@ -298,9 +304,16 @@ github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5P github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/cloudfoundry-community/go-cfclient v0.0.0-20201123235753-4f46d6348a05 h1:5Hbn8fSLiRX8dje5E22dk/6SuJnbd+pnwjFCGyb8St0= github.com/cloudfoundry-community/go-cfclient v0.0.0-20201123235753-4f46d6348a05/go.mod h1:UGbOgL5sX52jB/PUVKOeRC17QYX4Afsq+bsIeMCD4VA= +github.com/cloudfoundry-incubator/bbs v0.0.0-20210901222458-044174eef746/go.mod h1:Q0VRlLGjj5O7wRZ2EfmrEfXpHEgz3LABchAFJe3lpnw= +github.com/cloudfoundry-incubator/executor v0.0.0-20210913224247-1c8b2ff139d9/go.mod h1:PeB7A0Ieb4rpqQ//ID5x0g2oiUCAQLtmZfgP8WnepOU= +github.com/cloudfoundry/dropsonde v1.0.0/go.mod h1:6zwvrWK5TpxBVYi1cdkE5WDsIO8E0n7qAJg3wR9B67c= +github.com/cloudfoundry/gosteno v0.0.0-20150423193413-0c8581caea35/go.mod h1:3YBPUR85RIrvaUTdA1dL38YSp6s3OHu1xrWLkGt2Mog= +github.com/cloudfoundry/loggregatorlib v0.0.0-20170823162133-36eddf15ef12/go.mod h1:ucj7+svyACshmxV3Zze2NAcEcdbBf9scZYR+QKCX9/w= +github.com/cloudfoundry/sonde-go v0.0.0-20171206171820-b33733203bb4/go.mod h1:GS0pCHd7onIsewbw8Ue9qa9pZPv2V88cUZDttK6KzgI= github.com/clusterhq/flocker-go v0.0.0-20160920122132-2b8b7259d313/go.mod h1:P1wt9Z3DP8O6W3rvwCt0REIlshg1InHImaLW0t3ObY0= github.com/cobaugh/osrelease v0.0.0-20181218015638-a93a0a55a249 h1:R0IDH8daQ3lODvu8YtxnIqqth5qMGCJyADoUQvmLx4o= github.com/cobaugh/osrelease v0.0.0-20181218015638-a93a0a55a249/go.mod h1:EHKW9yNEYSBpTKzuu7Y9oOrft/UlzH57rMIB03oev6M= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q= @@ -398,12 +411,9 @@ github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgU github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= github.com/coredns/corefile-migration v1.0.10/go.mod h1:RMy/mXdeDlYwzt0vdMEJvT2hGJ2I86/eO0UdXmH9XNI= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY= github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.25+incompatible h1:0GQEw6h3YnuOVdtwygkIfJ+Omx0tZ8/QkVyXI4LkbeY= -github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= @@ -485,14 +495,16 @@ github.com/emicklei/go-restful v2.9.6+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/emicklei/go-restful v2.14.3+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.15.0+incompatible h1:8KpYO/Xl/ZudZs5RNOEhWMBY4hmzlZhhRd9cu+jrZP4= github.com/emicklei/go-restful v2.15.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful-openapi v1.4.1 h1:SocVTIQWnXyit4dotTrwmncBAjtRaBmfcHjo3XGcCm4= github.com/emicklei/go-restful-openapi v1.4.1/go.mod h1:kWQ8rQMVQ6G6lePwjDveJ00KjAUr/jq6z1X8DrDP3Gc= github.com/emicklei/go-restful-swagger12 v0.0.0-20201014110547-68ccff494617/go.mod h1:qr0VowGBT4CS4Q8vFF8BSeKz34PuqKGxs/L0IAQA9DQ= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= +github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -508,7 +520,6 @@ github.com/florianl/go-tc v0.2.0/go.mod h1:aWdDOHrIpaff8cZp6z7dgJZ1bRsgTS6pXIW0x github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= @@ -614,8 +625,10 @@ github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-test/deep v1.0.5 h1:AKODKU3pDH1RzZzm6YZu77YWtEAq6uh1rLIAQlay2qc= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.5/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= +github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= +github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/goccy/go-yaml v1.7.5/go.mod h1:wS4gNoLalDSJxo/SpngzPQ2BN4uuZVLCmbM4S3vd4+Y= @@ -931,13 +944,15 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/lebauce/aptly v0.7.2-0.20210723103859-345a32860f4d h1:6k4uyp3yRFzEmzQZjnneNYhIvNvvcu9XIvFyalzuBAE= github.com/lebauce/aptly v0.7.2-0.20210723103859-345a32860f4d/go.mod h1:Uot/EzgnIw6okZTyEZ/Q8+er5ZXy2Bqrrabr/M6OxUE= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.3 h1:v9QZf2Sn6AmjXtQeFpdoq/eaNtYP6IN+7lcrygsIAtg= +github.com/lib/pq v1.10.3/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libopenstorage/openstorage v1.0.0/go.mod h1:Sp1sIObHjat1BeXhfMqLZ14wnOzEhNx2YQedreMcUyc= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= +github.com/loggregator/go-bindata v0.0.0-20190422223605-5f11cfb2d7d9/go.mod h1:PvsJfK9t/8OdGvSanpYlwJ1EPoJ/hwT3c52txAzqooY= github.com/lpabon/godbc v0.1.1/go.mod h1:Jo9QV0cf3U6jZABgiJ2skINAXb9j8m51r07g4KI92ZA= github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f/go.mod h1:JpH9J1c9oX6otFSgdUHwUBUizmKlrMjxWnIAjff4m04= github.com/lucas-clemente/quic-clients v0.1.0/go.mod h1:y5xVIEoObKqULIKivu+gD/LU90pL73bTdtQjPBvtCBk= @@ -1075,8 +1090,6 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/n9e/agent-payload v0.0.0-20210803052830-38cc6d91cc21 h1:YIz+LiGh6aNamA6zdT5AJgIZtacdEg73ZYTp5OPIBFE= github.com/n9e/agent-payload v0.0.0-20210803052830-38cc6d91cc21/go.mod h1:qglO/Vsh4hMXMbrLk5LOQtni/pCCCksIDyn3hbmWKCY= -github.com/n9e/agent-payload v4.71.0+incompatible h1:mqlnjLJa5/sv0KEDa769FQO6BTr/+JA6ht4HxiQHiaU= -github.com/n9e/agent-payload v4.71.0+incompatible/go.mod h1:CwQelo3j8LTv/tOkUApNOGh1q2nbRMNVr2vTW4mISNc= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.1/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -1115,8 +1128,10 @@ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= +github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1126,8 +1141,9 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= +github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1193,6 +1209,8 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pierrec/lz4/v4 v4.0.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pierrec/lz4/v4 v4.1.3 h1:/dvQpkb0o1pVlSgKNQqfkavlnXaIK+hJ0LXsKRUN9D4= github.com/pierrec/lz4/v4 v4.1.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pivotal-golang/clock v1.0.0/go.mod h1:+mfK55nFzC6GZpxsSI3MpI4NkRjsRCaVjf1o/QqUNkc= +github.com/pivotal-golang/lager v2.0.0+incompatible/go.mod h1:EJZBAWMz/TvxVfLaBRwCv+gszrSByWbqQBRwfVbUhvM= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1204,6 +1222,7 @@ 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/poy/eachers v0.0.0-20181020210610-23942921fe77/go.mod h1:x1vqpbcMW9T/KRcQ4b48diSiSVtYgvwQ5xzDByEg4WE= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -1387,7 +1406,6 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc h1:yUaosF github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/twmb/murmur3 v1.1.5 h1:i9OLS9fkuLzBXjt6dptlAEyk58fJsSTXbRg3SgVyqgk= github.com/twmb/murmur3 v1.1.5/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= -github.com/uber-go/tally v3.3.17+incompatible h1:nFHIuW3VQ22wItiE9kPXic8dEgExWOsVOHwpmoIvsMw= github.com/uber-go/tally v3.3.17+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyufu1cEi0jdVnRdxvjnmU= github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= @@ -1444,11 +1462,11 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xor-gate/ar v0.0.0-20170530204233-5c72ae81e2b7 h1:Vo3q7h44BfmnLQh5SdF+2xwIoVnHThmZLunx6odjrHI= github.com/xor-gate/ar v0.0.0-20170530204233-5c72ae81e2b7/go.mod h1:TCWCUPhQU1j7axqROa/VHnlgJGHthAOqJZahg7b/DUc= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yubo/apiserver v0.0.0-20210818114029-aa8851f65709 h1:2hUjQvyvbBDqZb0XELJYuT9PWQQzxgO6i3JufZndJS0= -github.com/yubo/apiserver v0.0.0-20210818114029-aa8851f65709/go.mod h1:GHE2slfvHmcKp7N4umAGuWGwTqbhQOCGaV5yB+AvcSI= +github.com/yubo/apiserver v0.0.0-20210918082128-653f7fb53aa9 h1:aAa+ijaYs2mnlU6Kvzb0fn6tEXfiKaIvvLOa1tIDVB0= +github.com/yubo/apiserver v0.0.0-20210918082128-653f7fb53aa9/go.mod h1:7txNjorBKoCdZ7L9AkJYH9uxjcSmHB4WdFuiQpGS0Lg= github.com/yubo/golib v0.0.0-20210816033817-49c454336790/go.mod h1:sOuGN8FoxpwF/+FJbYNy2HqF2TfRpHWp/QiSBZ9rHOQ= -github.com/yubo/golib v0.0.0-20210818091248-62b6daa0f29d h1:NqwpcYWMpewbfljsyZahh7NnzCGmum0XRtAujYsgDOo= -github.com/yubo/golib v0.0.0-20210818091248-62b6daa0f29d/go.mod h1:sOuGN8FoxpwF/+FJbYNy2HqF2TfRpHWp/QiSBZ9rHOQ= +github.com/yubo/golib v0.0.0-20210922085935-91c4ef1612a4 h1:4Ts+9Yxk136lDWcxDDMavRy/tQcGm62eojrBCnRMloY= +github.com/yubo/golib v0.0.0-20210922085935-91c4ef1612a4/go.mod h1:f+GOVYqZtop+KHNHX9ADHpa85jaHAnmVnaWLjx/WDGs= github.com/yubo/goswagger v0.0.0-20210729084640-1f6e710ffaaf/go.mod h1:gAX7WMxJB3z/fcLwP8VCrkZh0Dj0X/5vaJlXtq/f5qo= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1462,9 +1480,8 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489 h1:1JFLBqwIgdyHN1ZtgjTBwO+blA6gVOmZurpiMEsETKo= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd v3.3.25+incompatible h1:V1RzkZJj9LqsJRy+TUBgpWSbZXITLB819lstuTFoZOY= -go.etcd.io/etcd v3.3.25+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI= go.etcd.io/etcd/api/v3 v3.5.0 h1:GsV3S+OfZEOCNXdtNkBSR7kgLobAa/SO6tCxRa0GAYw= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0 h1:2aQv6F436YnN7I4VbI8PPYrBhu+SmrTaADcf8Mi/6PU= @@ -1644,8 +1661,10 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1697,6 +1716,7 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1781,8 +1801,10 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210601080250-7ecdf8ef093b h1:qh4f65QIVFjq9eBURLEYWqaEXmOyqdUyiBSgaXWccWk= golang.org/x/sys v0.0.0-20210601080250-7ecdf8ef093b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71 h1:ikCpsnYR+Ew0vu99XlDp55lGgDJdIMx3f4a18jfse/s= +golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -2116,6 +2138,7 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl k8s.io/utils v0.0.0-20200912215256-4140de9c8800/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/staging/datadog-agent/pkg/process/config/config.go b/staging/datadog-agent/pkg/process/config/config.go index dbc438d8..ce3b4c72 100644 --- a/staging/datadog-agent/pkg/process/config/config.go +++ b/staging/datadog-agent/pkg/process/config/config.go @@ -3,7 +3,6 @@ package config import ( "bytes" "context" - "errors" "fmt" "net" "net/http" @@ -21,6 +20,7 @@ import ( pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo" "github.com/DataDog/datadog-agent/pkg/util/fargate" ddgrpc "github.com/DataDog/datadog-agent/pkg/util/grpc" + "github.com/DataDog/datadog-agent/pkg/util/hostname/validate" "github.com/DataDog/datadog-agent/pkg/util/log" model "github.com/n9e/agent-payload/process" "github.com/n9e/n9e-agentd/pkg/config" @@ -93,19 +93,19 @@ type AgentConfig struct { MaxConnsPerMessage int AllowRealTime bool Transport *http.Transport `json:"-"` - DDAgentBin string - StatsdHost string - StatsdPort int - ProcessExpVarPort int - ProfilingEnabled bool - ProfilingSite string - ProfilingURL string - ProfilingEnvironment string - ProfilingPeriod time.Duration - ProfilingCPUDuration time.Duration - ProfilingMutexFraction int - ProfilingBlockRate int - ProfilingWithGoroutines bool + //DDAgentBin string + StatsdHost string + StatsdPort int + ProcessExpVarPort int + ProfilingEnabled bool + ProfilingSite string + ProfilingURL string + ProfilingEnvironment string + ProfilingPeriod time.Duration + ProfilingCPUDuration time.Duration + ProfilingMutexFraction int + ProfilingBlockRate int + ProfilingWithGoroutines bool // host type of the agent, used to populate container payload with additional host information ContainerHostType model.ContainerHostType @@ -145,7 +145,7 @@ func (a AgentConfig) CheckInterval(checkName string) time.Duration { } const ( - defaultProcessEndpoint = "https://process.datadoghq.com" + defaultProcessEndpoint = "http://localhost:8000" maxMessageBatch = 100 defaultMaxCtrProcsMessageBatch = 10000 maxCtrProcsMessageBatch = 30000 @@ -251,123 +251,115 @@ func NewDefaultAgentConfig(canAccessContainers bool) *AgentConfig { return ac } -func loadConfigIfExists(path string) error { - //if path != "" { - // if util.PathExists(path) { - // config.Datadog.AddConfigPath(path) - // if strings.HasSuffix(path, ".yaml") { // If they set a config file directly, let's try to honor that - // config.Datadog.SetConfigFile(path) - // } - - // if _, err := config.LoadWithoutSecret(); err != nil { - // return err - // } - // } else { - // log.Infof("no config exists at %s, ignoring...", path) - // } - //} - log.Infof("unsupported load config") - return errors.New("unsupported load config") -} +//func loadConfigIfExists(path string) error { +//if path != "" { +// if util.PathExists(path) { +// config.Datadog.AddConfigPath(path) +// if strings.HasSuffix(path, ".yaml") { // If they set a config file directly, let's try to honor that +// config.Datadog.SetConfigFile(path) +// } + +// if _, err := config.LoadWithoutSecret(); err != nil { +// return err +// } +// } else { +// log.Infof("no config exists at %s, ignoring...", path) +// } +//} +// return nil +//} // NewAgentConfig returns an AgentConfig using a configuration file. It can be nil // if there is no file available. In this case we'll configure only via environment. -func NewAgentConfig(loggerName config.LoggerName, yamlPath, netYamlPath string) (*AgentConfig, error) { - return nil, errors.New("unsupported") - //var err error +//func NewAgentConfig(loggerName config.LoggerName, yamlPath, netYamlPath string) (*AgentConfig, error) { +func NewAgentConfig() (*AgentConfig, error) { + var err error - //// For Agent 6 we will have a YAML config file to use. + // For Agent 6 we will have a YAML config file to use. //if err := loadConfigIfExists(yamlPath); err != nil { // return nil, err //} - //// Note: This only considers container sources that are already setup. It's possible that container sources may - //// need a few minutes to be ready on newly provisioned hosts. - //_, err = util.GetContainers() - //canAccessContainers := err == nil + // Note: This only considers container sources that are already setup. It's possible that container sources may + // need a few minutes to be ready on newly provisioned hosts. + _, err = util.GetContainers() + canAccessContainers := err == nil - //cfg := NewDefaultAgentConfig(canAccessContainers) + cfg := NewDefaultAgentConfig(canAccessContainers) - //if err := cfg.LoadProcessYamlConfig(yamlPath); err != nil { - // return nil, err - //} + if err := cfg.LoadProcessYamlConfig(); err != nil { + return nil, err + } - //if err := cfg.Orchestrator.Load(); err != nil { - // return nil, err - //} + if err := cfg.Orchestrator.Load(); err != nil { + return nil, err + } - //// (Re)configure the logging from our configuration + // (Re)configure the logging from our configuration //if err := setupLogger(loggerName, cfg.LogFile, cfg); err != nil { // log.Errorf("failed to setup configured logger: %s", err) // return nil, err //} - //// For system probe, there is an additional config file that is shared with the system-probe - //syscfg, err := sysconfig.Merge(netYamlPath) - //if err != nil { - // return nil, err - //} - //if syscfg.Enabled { - // cfg.EnableSystemProbe = true - // cfg.MaxConnsPerMessage = syscfg.MaxConnsPerMessage - // cfg.SystemProbeAddress = syscfg.SocketAddress - - // // enable corresponding checks to system-probe modules - // for mod := range syscfg.EnabledModules { - // if checks, ok := moduleCheckMap[mod]; ok { - // cfg.EnabledChecks = append(cfg.EnabledChecks, checks...) - // } - // } + // For system probe, there is an additional config file that is shared with the system-probe + syscfg := &config.C.SystemProbe + if syscfg.Enabled { + cfg.EnableSystemProbe = true + cfg.MaxConnsPerMessage = syscfg.MaxConnsPerMessage + cfg.SystemProbeAddress = syscfg.SysprobeSocket + + // enable corresponding checks to system-probe modules + for mod := range syscfg.EnabledModules { + if checks, ok := moduleCheckMap[sysconfig.ModuleName(mod)]; ok { + cfg.EnabledChecks = append(cfg.EnabledChecks, checks...) + } + } - // if !cfg.Enabled { - // log.Info("enabling process-agent for connections check as the system-probe is enabled") - // cfg.Enabled = true - // } - //} + if !cfg.Enabled { + log.Info("enabling process-agent for connections check as the system-probe is enabled") + cfg.Enabled = true + } + } - //// TODO: Once proxies have been moved to common config util, remove this - //if cfg.proxy, err = proxyFromEnv(cfg.proxy); err != nil { - // log.Errorf("error parsing environment proxy settings, not using a proxy: %s", err) - // cfg.proxy = nil - //} + // TODO: Once proxies have been moved to common config util, remove this + if cfg.proxy, err = proxyFromEnv(cfg.proxy); err != nil { + log.Errorf("error parsing environment proxy settings, not using a proxy: %s", err) + cfg.proxy = nil + } - //// Python-style log level has WARNING vs WARN - //if strings.ToLower(cfg.LogLevel) == "warning" { - // cfg.LogLevel = "warn" - //} + // Python-style log level has WARNING vs WARN + if strings.ToLower(cfg.LogLevel) == "warning" { + cfg.LogLevel = "warn" + } - //if err := validate.ValidHostname(cfg.HostName); err != nil { - // // lookup hostname if there is no config override or if the override is invalid - // if hostname, err := getHostname(context.TODO(), cfg.DDAgentBin, cfg.grpcConnectionTimeout); err == nil { - // cfg.HostName = hostname - // } else { - // log.Errorf("Cannot get hostname: %v", err) - // } - //} + if err := validate.ValidHostname(cfg.HostName); err != nil { + // lookup hostname if there is no config override or if the override is invalid + log.Errorf("Cannot get hostname: %v", err) + } - //cfg.ContainerHostType = getContainerHostType() + cfg.ContainerHostType = getContainerHostType() - //if cfg.proxy != nil { - // cfg.Transport.Proxy = cfg.proxy - //} + if cfg.proxy != nil { + cfg.Transport.Proxy = cfg.proxy + } - //// sanity check. This element is used with the modulo operator (%), so it can't be zero. - //// if it is, log the error, and assume the config was attempting to disable - //if cfg.Windows.ArgsRefreshInterval == 0 { - // log.Warnf("invalid configuration: windows_collect_skip_new_args was set to 0. Disabling argument collection") - // cfg.Windows.ArgsRefreshInterval = -1 - //} + // sanity check. This element is used with the modulo operator (%), so it can't be zero. + // if it is, log the error, and assume the config was attempting to disable + if cfg.Windows.ArgsRefreshInterval == 0 { + log.Warnf("invalid configuration: windows_collect_skip_new_args was set to 0. Disabling argument collection") + cfg.Windows.ArgsRefreshInterval = -1 + } - //// activate the pod collection if enabled and we have the cluster name set - //if cfg.Orchestrator.OrchestrationCollectionEnabled { - // if cfg.Orchestrator.KubeClusterName != "" { - // cfg.EnabledChecks = append(cfg.EnabledChecks, PodCheckName) - // } else { - // log.Warnf("Failed to auto-detect a Kubernetes cluster name. Pod collection will not start. To fix this, set it manually via the cluster_name config option") - // } - //} + // activate the pod collection if enabled and we have the cluster name set + if cfg.Orchestrator.OrchestrationCollectionEnabled { + if cfg.Orchestrator.KubeClusterName != "" { + cfg.EnabledChecks = append(cfg.EnabledChecks, PodCheckName) + } else { + log.Warnf("Failed to auto-detect a Kubernetes cluster name. Pod collection will not start. To fix this, set it manually via the cluster_name config option") + } + } - //return cfg, nil + return cfg, nil } // getContainerHostType uses the fargate library to detect container environment and returns the protobuf version of it diff --git a/staging/datadog-agent/pkg/process/config/config_nix_test.go b/staging/datadog-agent/pkg/process/config/config_nix_test.go index 4347e0eb..98ba242f 100644 --- a/staging/datadog-agent/pkg/process/config/config_nix_test.go +++ b/staging/datadog-agent/pkg/process/config/config_nix_test.go @@ -1,116 +1,117 @@ +//go:build linux && secrets // +build linux,secrets package config -import ( - "fmt" - "os" - "os/exec" - "strings" - "sync" - "testing" - - // This test calls ContainerProvider behind the scene, need to initialize the linux provider - "github.com/n9e/n9e-agentd/pkg/config" - _ "github.com/DataDog/datadog-agent/pkg/util/containers/providers/cgroup" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -var secretScriptBuilder sync.Once - -func setupSecretScript() error { - script := "./testdata/secret" - goCmd, err := exec.LookPath("go") - if err != nil { - return fmt.Errorf("Couldn't find golang binary in path") - } - - buildCmd := exec.Command(goCmd, "build", "-o", script, fmt.Sprintf("%s.go", script)) - if err := buildCmd.Start(); err != nil { - return fmt.Errorf("Couldn't build script %v: %s", script, err) - } - if err := buildCmd.Wait(); err != nil { - return fmt.Errorf("Couldn't wait the end of the build for script %v: %s", script, err) - } - - // Permissions required for the secret script - err = os.Chmod(script, 0700) - if err != nil { - return err - } - - return os.Chown(script, os.Geteuid(), os.Getgid()) -} - -// TestAgentConfigYamlEnc tests the secrets feature on the file TestDDAgentConfigYamlEnc -func TestAgentConfigYamlEnc(t *testing.T) { - secretScriptBuilder.Do(func() { require.NoError(t, setupSecretScript()) }) - - config.Datadog = config.NewConfig("datadog", "DD", strings.NewReplacer(".", "_")) - defer restoreGlobalConfig() - // Secrets settings are initialized only once by initConfig in the agent package so we have to setup them - config.Datadog.Set("secret_backend_timeout", 15) - config.Datadog.Set("secret_backend_output_max_size", 1024) - - assert := assert.New(t) - - agentConfig, err := NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlEnc.yaml", - "", - ) - assert.NoError(err) - - ep := agentConfig.APIEndpoints[0] - assert.Equal("secret-my_api_key", ep.APIKey) -} - -// TestAgentConfigYamlEnc2 tests the secrets feature on the file TestDDAgentConfigYamlEnc2 -func TestAgentConfigYamlEnc2(t *testing.T) { - secretScriptBuilder.Do(func() { require.NoError(t, setupSecretScript()) }) - - config.Datadog = config.NewConfig("datadog", "DD", strings.NewReplacer(".", "_")) - defer restoreGlobalConfig() - // Secrets settings are initialized only once by initConfig in the agent package so we have to setup them - config.Datadog.Set("secret_backend_timeout", 15) - config.Datadog.Set("secret_backend_output_max_size", 1024) - assert := assert.New(t) - agentConfig, err := NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlEnc2.yaml", - "", - ) - assert.NoError(err) - - ep := agentConfig.APIEndpoints[0] - assert.Equal("secret-encrypted_key", ep.APIKey) - assert.Equal("secret-burrito.com", ep.Endpoint.String()) -} - -func TestAgentEncryptedVariablesSecrets(t *testing.T) { - secretScriptBuilder.Do(func() { require.NoError(t, setupSecretScript()) }) - - config.Datadog = config.NewConfig("datadog", "DD", strings.NewReplacer(".", "_")) - defer restoreGlobalConfig() - - // Secrets settings are initialized only once by initConfig in the agent package so we have to setup them - config.Datadog.Set("secret_backend_timeout", 15) - config.Datadog.Set("secret_backend_output_max_size", 1024) - - os.Setenv("DD_API_KEY", "ENC[my_api_key]") - os.Setenv("DD_HOSTNAME", "ENC[my-host]") // Valid hostnames do not use underscores - defer os.Unsetenv("DD_API_KEY") - defer os.Unsetenv("DD_HOSTNAME") - - assert := assert.New(t) - agentConfig, err := NewAgentConfig( - "test", "./testdata/TestEnvSiteConfig-Enc.yaml", "", - ) - assert.NoError(err) - - assert.Equal("secret-my_api_key", config.Datadog.Get("api_key")) - ep := agentConfig.APIEndpoints[0] - assert.Equal("secret-my_api_key", ep.APIKey) - assert.Equal("secret-my-host", agentConfig.HostName) -} +//import ( +// "fmt" +// "os" +// "os/exec" +// "strings" +// "sync" +// "testing" +// +// // This test calls ContainerProvider behind the scene, need to initialize the linux provider +// "github.com/n9e/n9e-agentd/pkg/config" +// _ "github.com/DataDog/datadog-agent/pkg/util/containers/providers/cgroup" +// "github.com/stretchr/testify/assert" +// "github.com/stretchr/testify/require" +//) +// +//var secretScriptBuilder sync.Once +// +//func setupSecretScript() error { +// script := "./testdata/secret" +// goCmd, err := exec.LookPath("go") +// if err != nil { +// return fmt.Errorf("Couldn't find golang binary in path") +// } +// +// buildCmd := exec.Command(goCmd, "build", "-o", script, fmt.Sprintf("%s.go", script)) +// if err := buildCmd.Start(); err != nil { +// return fmt.Errorf("Couldn't build script %v: %s", script, err) +// } +// if err := buildCmd.Wait(); err != nil { +// return fmt.Errorf("Couldn't wait the end of the build for script %v: %s", script, err) +// } +// +// // Permissions required for the secret script +// err = os.Chmod(script, 0700) +// if err != nil { +// return err +// } +// +// return os.Chown(script, os.Geteuid(), os.Getgid()) +//} +// +//// TestAgentConfigYamlEnc tests the secrets feature on the file TestDDAgentConfigYamlEnc +////func TestAgentConfigYamlEnc(t *testing.T) { +//// secretScriptBuilder.Do(func() { require.NoError(t, setupSecretScript()) }) +//// +//// config.Datadog = config.NewConfig("datadog", "DD", strings.NewReplacer(".", "_")) +//// defer restoreGlobalConfig() +//// // Secrets settings are initialized only once by initConfig in the agent package so we have to setup them +//// config.Datadog.Set("secret_backend_timeout", 15) +//// config.Datadog.Set("secret_backend_output_max_size", 1024) +//// +//// assert := assert.New(t) +//// +//// agentConfig, err := NewAgentConfig( +//// "test", +//// "./testdata/TestDDAgentConfigYamlEnc.yaml", +//// "", +//// ) +//// assert.NoError(err) +//// +//// ep := agentConfig.APIEndpoints[0] +//// assert.Equal("secret-my_api_key", ep.APIKey) +////} +// +//// TestAgentConfigYamlEnc2 tests the secrets feature on the file TestDDAgentConfigYamlEnc2 +//func TestAgentConfigYamlEnc2(t *testing.T) { +// secretScriptBuilder.Do(func() { require.NoError(t, setupSecretScript()) }) +// +// config.Datadog = config.NewConfig("datadog", "DD", strings.NewReplacer(".", "_")) +// defer restoreGlobalConfig() +// // Secrets settings are initialized only once by initConfig in the agent package so we have to setup them +// config.Datadog.Set("secret_backend_timeout", 15) +// config.Datadog.Set("secret_backend_output_max_size", 1024) +// assert := assert.New(t) +// agentConfig, err := NewAgentConfig( +// "test", +// "./testdata/TestDDAgentConfigYamlEnc2.yaml", +// "", +// ) +// assert.NoError(err) +// +// ep := agentConfig.APIEndpoints[0] +// assert.Equal("secret-encrypted_key", ep.APIKey) +// assert.Equal("secret-burrito.com", ep.Endpoint.String()) +//} +// +//func TestAgentEncryptedVariablesSecrets(t *testing.T) { +// secretScriptBuilder.Do(func() { require.NoError(t, setupSecretScript()) }) +// +// config.Datadog = config.NewConfig("datadog", "DD", strings.NewReplacer(".", "_")) +// defer restoreGlobalConfig() +// +// // Secrets settings are initialized only once by initConfig in the agent package so we have to setup them +// config.Datadog.Set("secret_backend_timeout", 15) +// config.Datadog.Set("secret_backend_output_max_size", 1024) +// +// os.Setenv("DD_API_KEY", "ENC[my_api_key]") +// os.Setenv("DD_HOSTNAME", "ENC[my-host]") // Valid hostnames do not use underscores +// defer os.Unsetenv("DD_API_KEY") +// defer os.Unsetenv("DD_HOSTNAME") +// +// assert := assert.New(t) +// agentConfig, err := NewAgentConfig( +// "test", "./testdata/TestEnvSiteConfig-Enc.yaml", "", +// ) +// assert.NoError(err) +// +// assert.Equal("secret-my_api_key", config.Datadog.Get("api_key")) +// ep := agentConfig.APIEndpoints[0] +// assert.Equal("secret-my_api_key", ep.APIKey) +// assert.Equal("secret-my-host", agentConfig.HostName) +//} diff --git a/staging/datadog-agent/pkg/process/config/config_test.go b/staging/datadog-agent/pkg/process/config/config_test.go index d8eafd18..899547f3 100644 --- a/staging/datadog-agent/pkg/process/config/config_test.go +++ b/staging/datadog-agent/pkg/process/config/config_test.go @@ -1,646 +1,647 @@ +//go:build linux || windows // +build linux windows package config -import ( - "context" - "errors" - "fmt" - "net/http" - "os" - "os/exec" - "regexp" - "runtime" - "strconv" - "strings" - "testing" - "time" - - "github.com/n9e/n9e-agentd/pkg/config" - "github.com/DataDog/datadog-agent/pkg/process/procutil" - pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo" - mocks "github.com/DataDog/datadog-agent/pkg/proto/pbgo/mocks" - "github.com/DataDog/datadog-agent/pkg/util/containers/providers" - providerMocks "github.com/DataDog/datadog-agent/pkg/util/containers/providers/mock" - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "google.golang.org/grpc" -) - -var originalConfig = config.Datadog - -func restoreGlobalConfig() { - providers.Deregister() - - config.Datadog = originalConfig -} - -func newConfig() { - providers.Register(providerMocks.FakeContainerImpl{}) - - config.Datadog = config.NewConfig("datadog", "DD", strings.NewReplacer(".", "_")) - config.InitConfig(config.Datadog) - // force timeout to 0s, otherwise each test waits 60s - config.Datadog.Set(key(ns, "grpc_connection_timeout_secs"), 0) -} - -func TestBlacklist(t *testing.T) { - testBlacklist := []string{ - "^getty", - "^acpid", - "^atd", - "^upstart-udev-bridge", - "^upstart-socket-bridge", - "^upstart-file-bridge", - "^dhclient", - "^dhclient3", - "^rpc", - "^dbus-daemon", - "udevd", - "^/sbin/", - "^/usr/sbin/", - "^/var/ossec/bin/ossec", - "^rsyslogd", - "^whoopsie$", - "^cron$", - "^CRON$", - "^/usr/lib/postfix/master$", - "^qmgr", - "^pickup", - "^sleep", - "^/lib/systemd/systemd-logind$", - "^/usr/local/bin/goshe dnsmasq$", - } - blacklist := make([]*regexp.Regexp, 0, len(testBlacklist)) - for _, b := range testBlacklist { - r, err := regexp.Compile(b) - if err == nil { - blacklist = append(blacklist, r) - } - } - cases := []struct { - cmdline []string - blacklisted bool - }{ - {[]string{"getty", "-foo", "-bar"}, true}, - {[]string{"rpcbind", "-x"}, true}, - {[]string{"my-rpc-app", "-config foo.ini"}, false}, - {[]string{"rpc.statd", "-L"}, true}, - {[]string{"/usr/sbin/irqbalance"}, true}, - } - - for _, c := range cases { - assert.Equal(t, c.blacklisted, IsBlacklisted(c.cmdline, blacklist), - fmt.Sprintf("Case %v failed", c)) - } -} - -func TestOnlyEnvConfig(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - - // setting an API Key should be enough to generate valid config - os.Setenv("DD_API_KEY", "apikey_from_env") - defer os.Unsetenv("DD_API_KEY") - os.Setenv("DD_PROCESS_AGENT_ENABLED", "true") - defer os.Unsetenv("DD_PROCESS_AGENT_ENABLED") - - agentConfig, _ := NewAgentConfig("test", "", "") - assert.Equal(t, "apikey_from_env", agentConfig.APIEndpoints[0].APIKey) - assert.True(t, agentConfig.Enabled) - - os.Setenv("DD_PROCESS_AGENT_ENABLED", "false") - agentConfig, _ = NewAgentConfig("test", "", "") - assert.Equal(t, "apikey_from_env", agentConfig.APIEndpoints[0].APIKey) - assert.False(t, agentConfig.Enabled) - - os.Setenv("DD_PROCESS_AGENT_MAX_PER_MESSAGE", "99") - agentConfig, _ = NewAgentConfig("test", "", "") - assert.Equal(t, 99, agentConfig.MaxPerMessage) - - os.Setenv("DD_PROCESS_AGENT_MAX_CTR_PROCS_PER_MESSAGE", "1234") - agentConfig, _ = NewAgentConfig("test", "", "") - assert.Equal(t, 1234, agentConfig.MaxCtrProcessesPerMessage) -} - -func TestOnlyEnvConfigArgsScrubbingEnabled(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - - os.Setenv("DD_CUSTOM_SENSITIVE_WORDS", "*password*,consul_token,*api_key") - defer os.Unsetenv("DD_CUSTOM_SENSITIVE_WORDS") - - agentConfig, _ := NewAgentConfig("test", "", "") - assert.Equal(t, true, agentConfig.Scrubber.Enabled) - - cases := []struct { - cmdline []string - parsedCmdline []string - }{ - { - []string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"}, - []string{"spidly", "--mypasswords=********", "consul_token", "********", "--dd_api_key=********"}, - }, - } - - for i := range cases { - cases[i].cmdline, _ = agentConfig.Scrubber.ScrubCommand(cases[i].cmdline) - assert.Equal(t, cases[i].parsedCmdline, cases[i].cmdline) - } -} - -func TestOnlyEnvConfigArgsScrubbingDisabled(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - - os.Setenv("DD_SCRUB_ARGS", "false") - os.Setenv("DD_CUSTOM_SENSITIVE_WORDS", "*password*,consul_token,*api_key") - defer os.Unsetenv("DD_SCRUB_ARGS") - defer os.Unsetenv("DD_CUSTOM_SENSITIVE_WORDS") - - agentConfig, _ := NewAgentConfig("test", "", "") - assert.Equal(t, false, agentConfig.Scrubber.Enabled) - - cases := []struct { - cmdline []string - parsedCmdline []string - }{ - { - []string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"}, - []string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"}, - }, - } - - for i := range cases { - fp := &procutil.Process{Cmdline: cases[i].cmdline} - cases[i].cmdline = agentConfig.Scrubber.ScrubProcessCommand(fp) - assert.Equal(t, cases[i].parsedCmdline, cases[i].cmdline) - } -} - -func TestOnlyEnvConfigLogLevelOverride(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - - os.Setenv("DD_LOG_LEVEL", "error") - defer os.Unsetenv("DD_LOG_LEVEL") - os.Setenv("LOG_LEVEL", "debug") - defer os.Unsetenv("LOG_LEVEL") - - agentConfig, _ := NewAgentConfig("test", "", "") - assert.Equal(t, "error", agentConfig.LogLevel) -} - -func TestGetHostname(t *testing.T) { - ctx := context.Background() - cfg := NewDefaultAgentConfig(false) - h, err := getHostname(ctx, cfg.DDAgentBin, 0) - assert.Nil(t, err) - // verify we fall back to getting os hostname - expectedHostname, _ := os.Hostname() - assert.Equal(t, expectedHostname, h) -} - -func TestDefaultConfig(t *testing.T) { - assert := assert.New(t) - agentConfig := NewDefaultAgentConfig(false) - - // assert that some sane defaults are set - assert.Equal("info", agentConfig.LogLevel) - assert.Equal(true, agentConfig.AllowRealTime) - assert.Equal(true, agentConfig.Scrubber.Enabled) - - os.Setenv("DOCKER_DD_AGENT", "yes") - agentConfig = NewDefaultAgentConfig(false) - assert.Equal(os.Getenv("HOST_PROC"), "") - assert.Equal(os.Getenv("HOST_SYS"), "") - os.Setenv("DOCKER_DD_AGENT", "no") - assert.Equal(6062, agentConfig.ProcessExpVarPort) - - os.Unsetenv("DOCKER_DD_AGENT") -} - -func TestAgentConfigYamlAndSystemProbeConfig(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - - assert := assert.New(t) - - agentConfig, err := NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", - "", - ) - assert.NoError(err) - - ep := agentConfig.APIEndpoints[0] - assert.Equal("apikey_20", ep.APIKey) - assert.Equal("my-process-app.datadoghq.com", ep.Endpoint.Hostname()) - assert.Equal(10, agentConfig.QueueSize) - assert.Equal(true, agentConfig.AllowRealTime) - assert.Equal(true, agentConfig.Enabled) - assert.Equal(append(processChecks), agentConfig.EnabledChecks) - assert.Equal(8*time.Second, agentConfig.CheckIntervals[ContainerCheckName]) - assert.Equal(30*time.Second, agentConfig.CheckIntervals[ProcessCheckName]) - assert.Equal(100, agentConfig.Windows.ArgsRefreshInterval) - assert.Equal(false, agentConfig.Windows.AddNewArgs) - assert.Equal(false, agentConfig.Scrubber.Enabled) - assert.Equal(5065, agentConfig.ProcessExpVarPort) - - newConfig() - agentConfig, err = NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net.yaml", - ) - assert.NoError(err) - - assert.Equal("apikey_20", ep.APIKey) - assert.Equal("my-process-app.datadoghq.com", ep.Endpoint.Hostname()) - assert.Equal("server-01", agentConfig.HostName) - assert.Equal(10, agentConfig.QueueSize) - assert.Equal(true, agentConfig.AllowRealTime) - assert.Equal(true, agentConfig.Enabled) - assert.Equal(8*time.Second, agentConfig.CheckIntervals[ContainerCheckName]) - assert.Equal(30*time.Second, agentConfig.CheckIntervals[ProcessCheckName]) - assert.Equal(100, agentConfig.Windows.ArgsRefreshInterval) - assert.Equal(false, agentConfig.Windows.AddNewArgs) - assert.Equal(false, agentConfig.Scrubber.Enabled) - if runtime.GOOS != "windows" { - assert.Equal("/var/my-location/system-probe.log", agentConfig.SystemProbeAddress) - } - assert.Equal(append(processChecks, ConnectionsCheckName, NetworkCheckName), agentConfig.EnabledChecks) - - newConfig() - agentConfig, err = NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net-2.yaml", - ) - assert.NoError(err) - - assert.Equal("apikey_20", ep.APIKey) - assert.Equal("my-process-app.datadoghq.com", ep.Endpoint.Hostname()) - assert.Equal(10, agentConfig.QueueSize) - assert.Equal(true, agentConfig.AllowRealTime) - assert.Equal(true, agentConfig.Enabled) - assert.Equal(8*time.Second, agentConfig.CheckIntervals[ContainerCheckName]) - assert.Equal(30*time.Second, agentConfig.CheckIntervals[ProcessCheckName]) - assert.Equal(100, agentConfig.Windows.ArgsRefreshInterval) - assert.Equal(false, agentConfig.Windows.AddNewArgs) - assert.Equal(false, agentConfig.Scrubber.Enabled) - if runtime.GOOS != "windows" { - assert.Equal("/var/my-location/system-probe.log", agentConfig.SystemProbeAddress) - } - assert.Equal(append(processChecks), agentConfig.EnabledChecks) - - newConfig() - agentConfig, err = NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net-Windows.yaml", - ) - assert.NoError(err) - - if runtime.GOOS == "windows" { - assert.Equal("localhost:4444", agentConfig.SystemProbeAddress) - } -} - -func TestProxyEnv(t *testing.T) { - assert := assert.New(t) - for i, tc := range []struct { - host string - port int - user string - pass string - expected string - }{ - { - "example.com", - 1234, - "", - "", - "http://example.com:1234", - }, - { - "https://example.com", - 4567, - "foo", - "bar", - "https://foo:bar@example.com:4567", - }, - { - "example.com", - 0, - "foo", - "", - "http://foo@example.com:3128", - }, - } { - os.Setenv("PROXY_HOST", tc.host) - if tc.port > 0 { - os.Setenv("PROXY_PORT", strconv.Itoa(tc.port)) - } else { - os.Setenv("PROXY_PORT", "") - } - os.Setenv("PROXY_USER", tc.user) - os.Setenv("PROXY_PASSWORD", tc.pass) - pf, err := proxyFromEnv(nil) - assert.NoError(err, "proxy case %d had error", i) - u, err := pf(&http.Request{}) - assert.NoError(err) - assert.Equal(tc.expected, u.String()) - } - - os.Unsetenv("PROXY_HOST") - os.Unsetenv("PROXY_PORT") - os.Unsetenv("PROXY_USER") - os.Unsetenv("PROXY_PASSWORD") -} - -func TestEnvSiteConfig(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - - assert := assert.New(t) - - newConfig() - agentConfig, err := NewAgentConfig("test", "./testdata/TestEnvSiteConfig.yaml", "") - assert.NoError(err) - assert.Equal("process.datadoghq.io", agentConfig.APIEndpoints[0].Endpoint.Hostname()) - - newConfig() - agentConfig, err = NewAgentConfig("test", "./testdata/TestEnvSiteConfig-2.yaml", "") - assert.NoError(err) - assert.Equal("process.datadoghq.eu", agentConfig.APIEndpoints[0].Endpoint.Hostname()) - - newConfig() - agentConfig, err = NewAgentConfig("test", "./testdata/TestEnvSiteConfig-3.yaml", "") - assert.NoError(err) - assert.Equal("burrito.com", agentConfig.APIEndpoints[0].Endpoint.Hostname()) - - newConfig() - os.Setenv("DD_PROCESS_AGENT_URL", "https://test.com") - agentConfig, err = NewAgentConfig("test", "./testdata/TestEnvSiteConfig-3.yaml", "") - assert.NoError(err) - assert.Equal("test.com", agentConfig.APIEndpoints[0].Endpoint.Hostname()) - - os.Unsetenv("DD_PROCESS_AGENT_URL") -} - -func TestEnvProcessAdditionalEndpoints(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - - assert := assert.New(t) - - expected := make(map[string]string) - expected["key1"] = "url1.com" - expected["key2"] = "url2.com" - expected["key3"] = "url2.com" - expected["apikey_20"] = "my-process-app.datadoghq.com" // from config file - - os.Setenv("DD_PROCESS_ADDITIONAL_ENDPOINTS", `{"https://url1.com": ["key1"], "https://url2.com": ["key2", "key3"]}`) - defer os.Unsetenv("DD_PROCESS_ADDITIONAL_ENDPOINTS") - - agentConfig, err := NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net.yaml", - ) - assert.NoError(err) - - for _, actual := range agentConfig.APIEndpoints { - assert.Equal(expected[actual.APIKey], actual.Endpoint.Hostname(), actual) - } -} - -func TestEnvOrchestratorAdditionalEndpoints(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - - assert := assert.New(t) - - expected := make(map[string]string) - expected["key1"] = "url1.com" - expected["key2"] = "url2.com" - expected["key3"] = "url2.com" - expected["apikey_20"] = "orchestrator.datadoghq.com" // from config file - - os.Setenv("DD_ORCHESTRATOR_ADDITIONAL_ENDPOINTS", `{"https://url1.com": ["key1"], "https://url2.com": ["key2", "key3"]}`) - defer os.Unsetenv("DD_ORCHESTRATOR_ADDITIONAL_ENDPOINTS") - - agentConfig, err := NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net.yaml", - ) - assert.NoError(err) - - for _, actual := range agentConfig.Orchestrator.OrchestratorEndpoints { - assert.Equal(expected[actual.APIKey], actual.Endpoint.Hostname(), actual) - } -} - -func TestEnvAdditionalEndpointsMalformed(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - - assert := assert.New(t) - - expected := make(map[string]string) - expected["apikey_20"] = "my-process-app.datadoghq.com" // from config file - - os.Setenv("DD_PROCESS_ADDITIONAL_ENDPOINTS", `"https://url1.com","key1"`) - defer os.Unsetenv("DD_PROCESS_ADDITIONAL_ENDPOINTS") - - agentConfig, err := NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", - "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net.yaml", - ) - assert.NoError(err) - - for _, actual := range agentConfig.APIEndpoints { - assert.Equal(expected[actual.APIKey], actual.Endpoint.Hostname(), actual) - } -} - -func TestNetworkConfig(t *testing.T) { - t.Run("yaml", func(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - - agentConfig, err := NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlOnly.yaml", - "./testdata/TestDDAgentConfig-NetConfig.yaml", - ) - require.NoError(t, err) - - assert.True(t, agentConfig.EnableSystemProbe) - assert.True(t, agentConfig.Enabled) - assert.ElementsMatch(t, []string{ConnectionsCheckName, NetworkCheckName, ProcessCheckName, RTProcessCheckName}, agentConfig.EnabledChecks) - }) - - t.Run("env", func(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - - os.Setenv("DD_SYSTEM_PROBE_NETWORK_ENABLED", "true") - defer os.Unsetenv("DD_SYSTEM_PROBE_NETWORK_ENABLED") - - agentConfig, err := NewAgentConfig("test", "", "") - require.NoError(t, err) - - assert.True(t, agentConfig.EnableSystemProbe) - assert.True(t, agentConfig.Enabled) - assert.ElementsMatch(t, []string{ConnectionsCheckName, NetworkCheckName, ContainerCheckName, RTContainerCheckName}, agentConfig.EnabledChecks) - }) -} - -func TestSystemProbeNoNetwork(t *testing.T) { - newConfig() - defer restoreGlobalConfig() - agentConfig, err := NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlOnly.yaml", - "./testdata/TestDDAgentConfig-OOMKillOnly.yaml", - ) - require.NoError(t, err) - - assert.True(t, agentConfig.EnableSystemProbe) - assert.True(t, agentConfig.Enabled) - assert.ElementsMatch(t, []string{OOMKillCheckName, ProcessCheckName, RTProcessCheckName}, agentConfig.EnabledChecks) - -} - -func TestIsAffirmative(t *testing.T) { - value, err := isAffirmative("yes") - assert.Nil(t, err) - assert.True(t, value) - - value, err = isAffirmative("True") - assert.Nil(t, err) - assert.True(t, value) - - value, err = isAffirmative("1") - assert.Nil(t, err) - assert.True(t, value) - - _, err = isAffirmative("") - assert.NotNil(t, err) - - value, err = isAffirmative("ok") - assert.Nil(t, err) - assert.False(t, value) -} - -func TestGetHostnameFromGRPC(t *testing.T) { - ctx := context.Background() - ctrl := gomock.NewController(t) - defer ctrl.Finish() - - mockClient := mocks.NewMockAgentClient(ctrl) - - mockClient.EXPECT().GetHostname( - gomock.Any(), - &pb.HostnameRequest{}, - ).Return(&pb.HostnameReply{Hostname: "unit-test-hostname"}, nil) - - t.Run("hostname returns from grpc", func(t *testing.T) { - hostname, err := getHostnameFromGRPC(ctx, func(ctx context.Context, opts ...grpc.DialOption) (pb.AgentClient, error) { - return mockClient, nil - }, defaultGRPCConnectionTimeout) - - assert.Nil(t, err) - assert.Equal(t, "unit-test-hostname", hostname) - }) - - t.Run("grpc client is unavailable", func(t *testing.T) { - grpcErr := errors.New("no grpc client") - hostname, err := getHostnameFromGRPC(ctx, func(ctx context.Context, opts ...grpc.DialOption) (pb.AgentClient, error) { - return nil, grpcErr - }, defaultGRPCConnectionTimeout) - - assert.NotNil(t, err) - assert.Equal(t, grpcErr, errors.Unwrap(err)) - assert.Empty(t, hostname) - }) -} - -func TestGetHostnameFromCmd(t *testing.T) { - t.Run("valid hostname", func(t *testing.T) { - h, err := getHostnameFromCmd("agent-success", fakeExecCommand) - assert.Nil(t, err) - assert.Equal(t, "unit_test_hostname", h) - }) - - t.Run("no hostname returned", func(t *testing.T) { - h, err := getHostnameFromCmd("agent-empty_hostname", fakeExecCommand) - assert.NotNil(t, err) - assert.Equal(t, "", h) - }) -} - -func TestInvalidHostname(t *testing.T) { - providers.Register(providerMocks.FakeContainerImpl{}) - defer providers.Deregister() - - // Input yaml file has an invalid hostname (localhost) so we expect to configure via environment - agentConfig, err := NewAgentConfig( - "test", - "./testdata/TestDDAgentConfigYamlOnly-InvalidHostname.yaml", - "", - ) - assert.NoError(t, err) - - expectedHostname, _ := os.Hostname() - assert.Equal(t, expectedHostname, agentConfig.HostName) -} - -// TestGetHostnameShellCmd is a method that is called as a substitute for a dd-agent shell command, -// the GO_TEST_PROCESS flag ensures that if it is called as part of the test suite, it is skipped. -func TestGetHostnameShellCmd(t *testing.T) { - if os.Getenv("GO_TEST_PROCESS") != "1" { - return - } - defer os.Exit(0) - - args := os.Args - for len(args) > 0 { - if args[0] == "--" { - args = args[1:] - break - } - args = args[1:] - } - - if len(args) == 0 { - fmt.Fprintf(os.Stderr, "No command\n") - os.Exit(2) - } - - cmd, args := args[0], args[1:] - switch cmd { - case "agent-success": - assert.EqualValues(t, []string{"hostname"}, args) - fmt.Fprintf(os.Stdout, "unit_test_hostname") - case "agent-empty_hostname": - assert.EqualValues(t, []string{"hostname"}, args) - fmt.Fprintf(os.Stdout, "") - } -} - -// fakeExecCommand is a function that initialises a new exec.Cmd, one which will -// simply call TestShellProcessSuccess rather than the command it is provided. It will -// also pass through the command and its arguments as an argument to TestShellProcessSuccess -func fakeExecCommand(command string, args ...string) *exec.Cmd { - cs := []string{"-test.run=TestGetHostnameShellCmd", "--", command} - cs = append(cs, args...) - cmd := exec.Command(os.Args[0], cs...) - cmd.Env = []string{"GO_TEST_PROCESS=1"} - return cmd -} +//import ( +// "context" +// "errors" +// "fmt" +// "net/http" +// "os" +// "os/exec" +// "regexp" +// "runtime" +// "strconv" +// "strings" +// "testing" +// "time" +// +// "github.com/DataDog/datadog-agent/pkg/process/procutil" +// pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo" +// mocks "github.com/DataDog/datadog-agent/pkg/proto/pbgo/mocks" +// "github.com/DataDog/datadog-agent/pkg/util/containers/providers" +// providerMocks "github.com/DataDog/datadog-agent/pkg/util/containers/providers/mock" +// "github.com/golang/mock/gomock" +// "github.com/n9e/n9e-agentd/pkg/config" +// "github.com/stretchr/testify/assert" +// "github.com/stretchr/testify/require" +// "google.golang.org/grpc" +//) +// +//var originalConfig = config.C +// +//func restoreGlobalConfig() { +// providers.Deregister() +// +// config.Datadog = originalConfig +//} +// +//func newConfig() { +// providers.Register(providerMocks.FakeContainerImpl{}) +// +// config.Datadog = config.NewConfig("datadog", "DD", strings.NewReplacer(".", "_")) +// config.InitConfig(config.Datadog) +// // force timeout to 0s, otherwise each test waits 60s +// config.Datadog.Set(key(ns, "grpc_connection_timeout_secs"), 0) +//} +// +//func TestBlacklist(t *testing.T) { +// testBlacklist := []string{ +// "^getty", +// "^acpid", +// "^atd", +// "^upstart-udev-bridge", +// "^upstart-socket-bridge", +// "^upstart-file-bridge", +// "^dhclient", +// "^dhclient3", +// "^rpc", +// "^dbus-daemon", +// "udevd", +// "^/sbin/", +// "^/usr/sbin/", +// "^/var/ossec/bin/ossec", +// "^rsyslogd", +// "^whoopsie$", +// "^cron$", +// "^CRON$", +// "^/usr/lib/postfix/master$", +// "^qmgr", +// "^pickup", +// "^sleep", +// "^/lib/systemd/systemd-logind$", +// "^/usr/local/bin/goshe dnsmasq$", +// } +// blacklist := make([]*regexp.Regexp, 0, len(testBlacklist)) +// for _, b := range testBlacklist { +// r, err := regexp.Compile(b) +// if err == nil { +// blacklist = append(blacklist, r) +// } +// } +// cases := []struct { +// cmdline []string +// blacklisted bool +// }{ +// {[]string{"getty", "-foo", "-bar"}, true}, +// {[]string{"rpcbind", "-x"}, true}, +// {[]string{"my-rpc-app", "-config foo.ini"}, false}, +// {[]string{"rpc.statd", "-L"}, true}, +// {[]string{"/usr/sbin/irqbalance"}, true}, +// } +// +// for _, c := range cases { +// assert.Equal(t, c.blacklisted, IsBlacklisted(c.cmdline, blacklist), +// fmt.Sprintf("Case %v failed", c)) +// } +//} +// +//func TestOnlyEnvConfig(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// +// // setting an API Key should be enough to generate valid config +// os.Setenv("DD_API_KEY", "apikey_from_env") +// defer os.Unsetenv("DD_API_KEY") +// os.Setenv("DD_PROCESS_AGENT_ENABLED", "true") +// defer os.Unsetenv("DD_PROCESS_AGENT_ENABLED") +// +// agentConfig, _ := NewAgentConfig("test", "", "") +// assert.Equal(t, "apikey_from_env", agentConfig.APIEndpoints[0].APIKey) +// assert.True(t, agentConfig.Enabled) +// +// os.Setenv("DD_PROCESS_AGENT_ENABLED", "false") +// agentConfig, _ = NewAgentConfig("test", "", "") +// assert.Equal(t, "apikey_from_env", agentConfig.APIEndpoints[0].APIKey) +// assert.False(t, agentConfig.Enabled) +// +// os.Setenv("DD_PROCESS_AGENT_MAX_PER_MESSAGE", "99") +// agentConfig, _ = NewAgentConfig("test", "", "") +// assert.Equal(t, 99, agentConfig.MaxPerMessage) +// +// os.Setenv("DD_PROCESS_AGENT_MAX_CTR_PROCS_PER_MESSAGE", "1234") +// agentConfig, _ = NewAgentConfig("test", "", "") +// assert.Equal(t, 1234, agentConfig.MaxCtrProcessesPerMessage) +//} +// +//func TestOnlyEnvConfigArgsScrubbingEnabled(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// +// os.Setenv("DD_CUSTOM_SENSITIVE_WORDS", "*password*,consul_token,*api_key") +// defer os.Unsetenv("DD_CUSTOM_SENSITIVE_WORDS") +// +// agentConfig, _ := NewAgentConfig("test", "", "") +// assert.Equal(t, true, agentConfig.Scrubber.Enabled) +// +// cases := []struct { +// cmdline []string +// parsedCmdline []string +// }{ +// { +// []string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"}, +// []string{"spidly", "--mypasswords=********", "consul_token", "********", "--dd_api_key=********"}, +// }, +// } +// +// for i := range cases { +// cases[i].cmdline, _ = agentConfig.Scrubber.ScrubCommand(cases[i].cmdline) +// assert.Equal(t, cases[i].parsedCmdline, cases[i].cmdline) +// } +//} +// +//func TestOnlyEnvConfigArgsScrubbingDisabled(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// +// os.Setenv("DD_SCRUB_ARGS", "false") +// os.Setenv("DD_CUSTOM_SENSITIVE_WORDS", "*password*,consul_token,*api_key") +// defer os.Unsetenv("DD_SCRUB_ARGS") +// defer os.Unsetenv("DD_CUSTOM_SENSITIVE_WORDS") +// +// agentConfig, _ := NewAgentConfig("test", "", "") +// assert.Equal(t, false, agentConfig.Scrubber.Enabled) +// +// cases := []struct { +// cmdline []string +// parsedCmdline []string +// }{ +// { +// []string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"}, +// []string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"}, +// }, +// } +// +// for i := range cases { +// fp := &procutil.Process{Cmdline: cases[i].cmdline} +// cases[i].cmdline = agentConfig.Scrubber.ScrubProcessCommand(fp) +// assert.Equal(t, cases[i].parsedCmdline, cases[i].cmdline) +// } +//} +// +//func TestOnlyEnvConfigLogLevelOverride(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// +// os.Setenv("DD_LOG_LEVEL", "error") +// defer os.Unsetenv("DD_LOG_LEVEL") +// os.Setenv("LOG_LEVEL", "debug") +// defer os.Unsetenv("LOG_LEVEL") +// +// agentConfig, _ := NewAgentConfig("test", "", "") +// assert.Equal(t, "error", agentConfig.LogLevel) +//} +// +//func TestGetHostname(t *testing.T) { +// ctx := context.Background() +// cfg := NewDefaultAgentConfig(false) +// h, err := getHostname(ctx, cfg.DDAgentBin, 0) +// assert.Nil(t, err) +// // verify we fall back to getting os hostname +// expectedHostname, _ := os.Hostname() +// assert.Equal(t, expectedHostname, h) +//} +// +//func TestDefaultConfig(t *testing.T) { +// assert := assert.New(t) +// agentConfig := NewDefaultAgentConfig(false) +// +// // assert that some sane defaults are set +// assert.Equal("info", agentConfig.LogLevel) +// assert.Equal(true, agentConfig.AllowRealTime) +// assert.Equal(true, agentConfig.Scrubber.Enabled) +// +// os.Setenv("DOCKER_DD_AGENT", "yes") +// agentConfig = NewDefaultAgentConfig(false) +// assert.Equal(os.Getenv("HOST_PROC"), "") +// assert.Equal(os.Getenv("HOST_SYS"), "") +// os.Setenv("DOCKER_DD_AGENT", "no") +// assert.Equal(6062, agentConfig.ProcessExpVarPort) +// +// os.Unsetenv("DOCKER_DD_AGENT") +//} +// +//func TestAgentConfigYamlAndSystemProbeConfig(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// +// assert := assert.New(t) +// +// agentConfig, err := NewAgentConfig( +// "test", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", +// "", +// ) +// assert.NoError(err) +// +// ep := agentConfig.APIEndpoints[0] +// assert.Equal("apikey_20", ep.APIKey) +// assert.Equal("my-process-app.datadoghq.com", ep.Endpoint.Hostname()) +// assert.Equal(10, agentConfig.QueueSize) +// assert.Equal(true, agentConfig.AllowRealTime) +// assert.Equal(true, agentConfig.Enabled) +// assert.Equal(append(processChecks), agentConfig.EnabledChecks) +// assert.Equal(8*time.Second, agentConfig.CheckIntervals[ContainerCheckName]) +// assert.Equal(30*time.Second, agentConfig.CheckIntervals[ProcessCheckName]) +// assert.Equal(100, agentConfig.Windows.ArgsRefreshInterval) +// assert.Equal(false, agentConfig.Windows.AddNewArgs) +// assert.Equal(false, agentConfig.Scrubber.Enabled) +// assert.Equal(5065, agentConfig.ProcessExpVarPort) +// +// newConfig() +// agentConfig, err = NewAgentConfig( +// "test", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net.yaml", +// ) +// assert.NoError(err) +// +// assert.Equal("apikey_20", ep.APIKey) +// assert.Equal("my-process-app.datadoghq.com", ep.Endpoint.Hostname()) +// assert.Equal("server-01", agentConfig.HostName) +// assert.Equal(10, agentConfig.QueueSize) +// assert.Equal(true, agentConfig.AllowRealTime) +// assert.Equal(true, agentConfig.Enabled) +// assert.Equal(8*time.Second, agentConfig.CheckIntervals[ContainerCheckName]) +// assert.Equal(30*time.Second, agentConfig.CheckIntervals[ProcessCheckName]) +// assert.Equal(100, agentConfig.Windows.ArgsRefreshInterval) +// assert.Equal(false, agentConfig.Windows.AddNewArgs) +// assert.Equal(false, agentConfig.Scrubber.Enabled) +// if runtime.GOOS != "windows" { +// assert.Equal("/var/my-location/system-probe.log", agentConfig.SystemProbeAddress) +// } +// assert.Equal(append(processChecks, ConnectionsCheckName, NetworkCheckName), agentConfig.EnabledChecks) +// +// newConfig() +// agentConfig, err = NewAgentConfig( +// "test", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net-2.yaml", +// ) +// assert.NoError(err) +// +// assert.Equal("apikey_20", ep.APIKey) +// assert.Equal("my-process-app.datadoghq.com", ep.Endpoint.Hostname()) +// assert.Equal(10, agentConfig.QueueSize) +// assert.Equal(true, agentConfig.AllowRealTime) +// assert.Equal(true, agentConfig.Enabled) +// assert.Equal(8*time.Second, agentConfig.CheckIntervals[ContainerCheckName]) +// assert.Equal(30*time.Second, agentConfig.CheckIntervals[ProcessCheckName]) +// assert.Equal(100, agentConfig.Windows.ArgsRefreshInterval) +// assert.Equal(false, agentConfig.Windows.AddNewArgs) +// assert.Equal(false, agentConfig.Scrubber.Enabled) +// if runtime.GOOS != "windows" { +// assert.Equal("/var/my-location/system-probe.log", agentConfig.SystemProbeAddress) +// } +// assert.Equal(append(processChecks), agentConfig.EnabledChecks) +// +// newConfig() +// agentConfig, err = NewAgentConfig( +// "test", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net-Windows.yaml", +// ) +// assert.NoError(err) +// +// if runtime.GOOS == "windows" { +// assert.Equal("localhost:4444", agentConfig.SystemProbeAddress) +// } +//} +// +//func TestProxyEnv(t *testing.T) { +// assert := assert.New(t) +// for i, tc := range []struct { +// host string +// port int +// user string +// pass string +// expected string +// }{ +// { +// "example.com", +// 1234, +// "", +// "", +// "http://example.com:1234", +// }, +// { +// "https://example.com", +// 4567, +// "foo", +// "bar", +// "https://foo:bar@example.com:4567", +// }, +// { +// "example.com", +// 0, +// "foo", +// "", +// "http://foo@example.com:3128", +// }, +// } { +// os.Setenv("PROXY_HOST", tc.host) +// if tc.port > 0 { +// os.Setenv("PROXY_PORT", strconv.Itoa(tc.port)) +// } else { +// os.Setenv("PROXY_PORT", "") +// } +// os.Setenv("PROXY_USER", tc.user) +// os.Setenv("PROXY_PASSWORD", tc.pass) +// pf, err := proxyFromEnv(nil) +// assert.NoError(err, "proxy case %d had error", i) +// u, err := pf(&http.Request{}) +// assert.NoError(err) +// assert.Equal(tc.expected, u.String()) +// } +// +// os.Unsetenv("PROXY_HOST") +// os.Unsetenv("PROXY_PORT") +// os.Unsetenv("PROXY_USER") +// os.Unsetenv("PROXY_PASSWORD") +//} +// +//func TestEnvSiteConfig(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// +// assert := assert.New(t) +// +// newConfig() +// agentConfig, err := NewAgentConfig("test", "./testdata/TestEnvSiteConfig.yaml", "") +// assert.NoError(err) +// assert.Equal("process.datadoghq.io", agentConfig.APIEndpoints[0].Endpoint.Hostname()) +// +// newConfig() +// agentConfig, err = NewAgentConfig("test", "./testdata/TestEnvSiteConfig-2.yaml", "") +// assert.NoError(err) +// assert.Equal("process.datadoghq.eu", agentConfig.APIEndpoints[0].Endpoint.Hostname()) +// +// newConfig() +// agentConfig, err = NewAgentConfig("test", "./testdata/TestEnvSiteConfig-3.yaml", "") +// assert.NoError(err) +// assert.Equal("burrito.com", agentConfig.APIEndpoints[0].Endpoint.Hostname()) +// +// newConfig() +// os.Setenv("DD_PROCESS_AGENT_URL", "https://test.com") +// agentConfig, err = NewAgentConfig("test", "./testdata/TestEnvSiteConfig-3.yaml", "") +// assert.NoError(err) +// assert.Equal("test.com", agentConfig.APIEndpoints[0].Endpoint.Hostname()) +// +// os.Unsetenv("DD_PROCESS_AGENT_URL") +//} +// +//func TestEnvProcessAdditionalEndpoints(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// +// assert := assert.New(t) +// +// expected := make(map[string]string) +// expected["key1"] = "url1.com" +// expected["key2"] = "url2.com" +// expected["key3"] = "url2.com" +// expected["apikey_20"] = "my-process-app.datadoghq.com" // from config file +// +// os.Setenv("DD_PROCESS_ADDITIONAL_ENDPOINTS", `{"https://url1.com": ["key1"], "https://url2.com": ["key2", "key3"]}`) +// defer os.Unsetenv("DD_PROCESS_ADDITIONAL_ENDPOINTS") +// +// agentConfig, err := NewAgentConfig( +// "test", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net.yaml", +// ) +// assert.NoError(err) +// +// for _, actual := range agentConfig.APIEndpoints { +// assert.Equal(expected[actual.APIKey], actual.Endpoint.Hostname(), actual) +// } +//} +// +//func TestEnvOrchestratorAdditionalEndpoints(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// +// assert := assert.New(t) +// +// expected := make(map[string]string) +// expected["key1"] = "url1.com" +// expected["key2"] = "url2.com" +// expected["key3"] = "url2.com" +// expected["apikey_20"] = "orchestrator.datadoghq.com" // from config file +// +// os.Setenv("DD_ORCHESTRATOR_ADDITIONAL_ENDPOINTS", `{"https://url1.com": ["key1"], "https://url2.com": ["key2", "key3"]}`) +// defer os.Unsetenv("DD_ORCHESTRATOR_ADDITIONAL_ENDPOINTS") +// +// agentConfig, err := NewAgentConfig( +// "test", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net.yaml", +// ) +// assert.NoError(err) +// +// for _, actual := range agentConfig.Orchestrator.OrchestratorEndpoints { +// assert.Equal(expected[actual.APIKey], actual.Endpoint.Hostname(), actual) +// } +//} +// +//func TestEnvAdditionalEndpointsMalformed(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// +// assert := assert.New(t) +// +// expected := make(map[string]string) +// expected["apikey_20"] = "my-process-app.datadoghq.com" // from config file +// +// os.Setenv("DD_PROCESS_ADDITIONAL_ENDPOINTS", `"https://url1.com","key1"`) +// defer os.Unsetenv("DD_PROCESS_ADDITIONAL_ENDPOINTS") +// +// agentConfig, err := NewAgentConfig( +// "test", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig.yaml", +// "./testdata/TestDDAgentConfigYamlAndSystemProbeConfig-Net.yaml", +// ) +// assert.NoError(err) +// +// for _, actual := range agentConfig.APIEndpoints { +// assert.Equal(expected[actual.APIKey], actual.Endpoint.Hostname(), actual) +// } +//} +// +//func TestNetworkConfig(t *testing.T) { +// t.Run("yaml", func(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// +// agentConfig, err := NewAgentConfig( +// "test", +// "./testdata/TestDDAgentConfigYamlOnly.yaml", +// "./testdata/TestDDAgentConfig-NetConfig.yaml", +// ) +// require.NoError(t, err) +// +// assert.True(t, agentConfig.EnableSystemProbe) +// assert.True(t, agentConfig.Enabled) +// assert.ElementsMatch(t, []string{ConnectionsCheckName, NetworkCheckName, ProcessCheckName, RTProcessCheckName}, agentConfig.EnabledChecks) +// }) +// +// t.Run("env", func(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// +// os.Setenv("DD_SYSTEM_PROBE_NETWORK_ENABLED", "true") +// defer os.Unsetenv("DD_SYSTEM_PROBE_NETWORK_ENABLED") +// +// agentConfig, err := NewAgentConfig("test", "", "") +// require.NoError(t, err) +// +// assert.True(t, agentConfig.EnableSystemProbe) +// assert.True(t, agentConfig.Enabled) +// assert.ElementsMatch(t, []string{ConnectionsCheckName, NetworkCheckName, ContainerCheckName, RTContainerCheckName}, agentConfig.EnabledChecks) +// }) +//} +// +//func TestSystemProbeNoNetwork(t *testing.T) { +// newConfig() +// defer restoreGlobalConfig() +// agentConfig, err := NewAgentConfig( +// "test", +// "./testdata/TestDDAgentConfigYamlOnly.yaml", +// "./testdata/TestDDAgentConfig-OOMKillOnly.yaml", +// ) +// require.NoError(t, err) +// +// assert.True(t, agentConfig.EnableSystemProbe) +// assert.True(t, agentConfig.Enabled) +// assert.ElementsMatch(t, []string{OOMKillCheckName, ProcessCheckName, RTProcessCheckName}, agentConfig.EnabledChecks) +// +//} +// +//func TestIsAffirmative(t *testing.T) { +// value, err := isAffirmative("yes") +// assert.Nil(t, err) +// assert.True(t, value) +// +// value, err = isAffirmative("True") +// assert.Nil(t, err) +// assert.True(t, value) +// +// value, err = isAffirmative("1") +// assert.Nil(t, err) +// assert.True(t, value) +// +// _, err = isAffirmative("") +// assert.NotNil(t, err) +// +// value, err = isAffirmative("ok") +// assert.Nil(t, err) +// assert.False(t, value) +//} +// +//func TestGetHostnameFromGRPC(t *testing.T) { +// ctx := context.Background() +// ctrl := gomock.NewController(t) +// defer ctrl.Finish() +// +// mockClient := mocks.NewMockAgentClient(ctrl) +// +// mockClient.EXPECT().GetHostname( +// gomock.Any(), +// &pb.HostnameRequest{}, +// ).Return(&pb.HostnameReply{Hostname: "unit-test-hostname"}, nil) +// +// t.Run("hostname returns from grpc", func(t *testing.T) { +// hostname, err := getHostnameFromGRPC(ctx, func(ctx context.Context, opts ...grpc.DialOption) (pb.AgentClient, error) { +// return mockClient, nil +// }, defaultGRPCConnectionTimeout) +// +// assert.Nil(t, err) +// assert.Equal(t, "unit-test-hostname", hostname) +// }) +// +// t.Run("grpc client is unavailable", func(t *testing.T) { +// grpcErr := errors.New("no grpc client") +// hostname, err := getHostnameFromGRPC(ctx, func(ctx context.Context, opts ...grpc.DialOption) (pb.AgentClient, error) { +// return nil, grpcErr +// }, defaultGRPCConnectionTimeout) +// +// assert.NotNil(t, err) +// assert.Equal(t, grpcErr, errors.Unwrap(err)) +// assert.Empty(t, hostname) +// }) +//} +// +//func TestGetHostnameFromCmd(t *testing.T) { +// t.Run("valid hostname", func(t *testing.T) { +// h, err := getHostnameFromCmd("agent-success", fakeExecCommand) +// assert.Nil(t, err) +// assert.Equal(t, "unit_test_hostname", h) +// }) +// +// t.Run("no hostname returned", func(t *testing.T) { +// h, err := getHostnameFromCmd("agent-empty_hostname", fakeExecCommand) +// assert.NotNil(t, err) +// assert.Equal(t, "", h) +// }) +//} +// +//func TestInvalidHostname(t *testing.T) { +// providers.Register(providerMocks.FakeContainerImpl{}) +// defer providers.Deregister() +// +// // Input yaml file has an invalid hostname (localhost) so we expect to configure via environment +// agentConfig, err := NewAgentConfig( +// "test", +// "./testdata/TestDDAgentConfigYamlOnly-InvalidHostname.yaml", +// "", +// ) +// assert.NoError(t, err) +// +// expectedHostname, _ := os.Hostname() +// assert.Equal(t, expectedHostname, agentConfig.HostName) +//} +// +//// TestGetHostnameShellCmd is a method that is called as a substitute for a dd-agent shell command, +//// the GO_TEST_PROCESS flag ensures that if it is called as part of the test suite, it is skipped. +//func TestGetHostnameShellCmd(t *testing.T) { +// if os.Getenv("GO_TEST_PROCESS") != "1" { +// return +// } +// defer os.Exit(0) +// +// args := os.Args +// for len(args) > 0 { +// if args[0] == "--" { +// args = args[1:] +// break +// } +// args = args[1:] +// } +// +// if len(args) == 0 { +// fmt.Fprintf(os.Stderr, "No command\n") +// os.Exit(2) +// } +// +// cmd, args := args[0], args[1:] +// switch cmd { +// case "agent-success": +// assert.EqualValues(t, []string{"hostname"}, args) +// fmt.Fprintf(os.Stdout, "unit_test_hostname") +// case "agent-empty_hostname": +// assert.EqualValues(t, []string{"hostname"}, args) +// fmt.Fprintf(os.Stdout, "") +// } +//} +// +//// fakeExecCommand is a function that initialises a new exec.Cmd, one which will +//// simply call TestShellProcessSuccess rather than the command it is provided. It will +//// also pass through the command and its arguments as an argument to TestShellProcessSuccess +//func fakeExecCommand(command string, args ...string) *exec.Cmd { +// cs := []string{"-test.run=TestGetHostnameShellCmd", "--", command} +// cs = append(cs, args...) +// cmd := exec.Command(os.Args[0], cs...) +// cmd.Env = []string{"GO_TEST_PROCESS=1"} +// return cmd +//} diff --git a/staging/datadog-agent/pkg/process/config/yaml_config.go b/staging/datadog-agent/pkg/process/config/yaml_config.go index c0adb370..f2861135 100644 --- a/staging/datadog-agent/pkg/process/config/yaml_config.go +++ b/staging/datadog-agent/pkg/process/config/yaml_config.go @@ -1,8 +1,17 @@ package config import ( + "fmt" + "net/url" + "regexp" "strings" + "time" + "github.com/DataDog/datadog-agent/pkg/process/util" + apicfg "github.com/DataDog/datadog-agent/pkg/process/util/api/config" + httputils "github.com/DataDog/datadog-agent/pkg/util/http" + "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/n9e/n9e-agentd/pkg/config" "github.com/pkg/errors" ) @@ -15,145 +24,105 @@ func key(pieces ...string) string { } // LoadProcessYamlConfig load Process-specific configuration -func (a *AgentConfig) LoadProcessYamlConfig(path string) error { - return errors.New("TODO") +func (a *AgentConfig) LoadProcessYamlConfig() error { //loadEnvVariables() - //// Resolve any secrets + // Resolve any secrets //if err := config.ResolveSecrets(config.Datadog, filepath.Base(path)); err != nil { // return err //} - //URL, err := url.Parse(config.GetMainEndpoint("https://process.", key(ns, "process_dd_url"))) - //if err != nil { - // return fmt.Errorf("error parsing process_dd_url: %s", err) - //} - //a.APIEndpoints[0].Endpoint = URL - - //if key := "api_key"; config.Datadog.IsSet(key) { - // a.APIEndpoints[0].APIKey = config.SanitizeAPIKey(config.Datadog.GetString(key)) - //} - - //if config.Datadog.IsSet("hostname") { - // a.HostName = config.Datadog.GetString("hostname") - //} - - //// Note: The enabled environment flag operates differently than that of our YAML configuration - //if v, ok := os.LookupEnv("DD_PROCESS_AGENT_ENABLED"); ok { - // // DD_PROCESS_AGENT_ENABLED: true - Process + Container checks enabled - // // false - No checks enabled - // // (none) - Container check enabled (by default) - // if enabled, err := isAffirmative(v); enabled { - // a.Enabled = true - // a.EnabledChecks = processChecks - // } else if !enabled && err == nil { - // a.Enabled = false - // } - //} else if k := key(ns, "enabled"); config.Datadog.IsSet(k) { - // // A string indicate the enabled state of the Agent. - // // If "false" (the default) we will only collect containers. - // // If "true" we will collect containers and processes. - // // If "disabled" the agent will be disabled altogether and won't start. - // enabled := config.Datadog.GetString(k) - // ok, err := isAffirmative(enabled) - // if ok { - // a.Enabled, a.EnabledChecks = true, processChecks - // } else if enabled == "disabled" { - // a.Enabled = false - // } else if !ok && err == nil { - // a.Enabled, a.EnabledChecks = true, containerChecks - // } - //} - - //// Whether or not the process-agent should output logs to console - //if config.Datadog.GetBool("log_to_console") { - // a.LogToConsole = true - //} - //// The full path to the file where process-agent logs will be written. - //if logFile := config.Datadog.GetString(key(ns, "log_file")); logFile != "" { - // a.LogFile = logFile - //} - - //// The interval, in seconds, at which we will run each check. If you want consistent - //// behavior between real-time you may set the Container/ProcessRT intervals to 10. - //// Defaults to 10s for normal checks and 2s for others. - //a.setCheckInterval(ns, "container", ContainerCheckName) - //a.setCheckInterval(ns, "container_realtime", RTContainerCheckName) - //a.setCheckInterval(ns, "process", ProcessCheckName) - //a.setCheckInterval(ns, "process_realtime", RTProcessCheckName) - //a.setCheckInterval(ns, "connections", ConnectionsCheckName) - - //// A list of regex patterns that will exclude a process if matched. + URL, err := url.Parse("http://" + config.GetMainEndpoint()) + if err != nil { + return fmt.Errorf("error parsing process_dd_url: %s", err) + } + a.APIEndpoints[0].Endpoint = URL + a.APIEndpoints[0].APIKey = config.C.ApiKey + a.HostName = config.C.Hostname + + pc := &config.C.ProcessConfig + // Note: The enabled environment flag operates differently than that of our YAML configuration + a.Enabled = pc.Enabled + if pc.ProcessCheck { + a.EnabledChecks = processChecks + } + // Whether or not the process-agent should output logs to console + a.LogToConsole = config.C.LogToConsole + // The full path to the file where process-agent logs will be written. + if logFile := pc.LogFile; logFile != "" { + a.LogFile = logFile + } + + // The interval, in seconds, at which we will run each check. If you want consistent + // behavior between real-time you may set the Container/ProcessRT intervals to 10. + // Defaults to 10s for normal checks and 2s for others. + { + c := pc.Intervals + a.setCheckInterval(ns, ContainerCheckName, c.Container.Duration) + a.setCheckInterval(ns, RTContainerCheckName, c.RTContainer.Duration) + a.setCheckInterval(ns, ProcessCheckName, c.Process.Duration) + a.setCheckInterval(ns, RTProcessCheckName, c.RTProcess.Duration) + a.setCheckInterval(ns, ConnectionsCheckName, c.Connections.Duration) + } + + // A list of regex patterns that will exclude a process if matched. //if k := key(ns, "blacklist_patterns"); config.Datadog.IsSet(k) { - // for _, b := range config.Datadog.GetStringSlice(k) { - // r, err := regexp.Compile(b) - // if err != nil { - // log.Warnf("Ignoring invalid blacklist pattern: %s", b) - // continue - // } - // a.Blacklist = append(a.Blacklist, r) - // } - //} - - //if k := key(ns, "expvar_port"); config.Datadog.IsSet(k) { - // port := config.Datadog.GetInt(k) - // if port <= 0 { - // return errors.Errorf("invalid %s -- %d", k, port) - // } - // a.ProcessExpVarPort = port - //} - - //// Enable/Disable the DataScrubber to obfuscate process args - //if scrubArgsKey := key(ns, "scrub_args"); config.Datadog.IsSet(scrubArgsKey) { - // a.Scrubber.Enabled = config.Datadog.GetBool(scrubArgsKey) - //} - - //// A custom word list to enhance the default one used by the DataScrubber - //if k := key(ns, "custom_sensitive_words"); config.Datadog.IsSet(k) { - // a.Scrubber.AddCustomSensitiveWords(config.Datadog.GetStringSlice(k)) - //} - - //// Strips all process arguments - //if config.Datadog.GetBool(key(ns, "strip_proc_arguments")) { - // a.Scrubber.StripAllArguments = true - //} - - //// How many check results to buffer in memory when POST fails. The default is usually fine. - //if k := key(ns, "queue_size"); config.Datadog.IsSet(k) { - // if queueSize := config.Datadog.GetInt(k); queueSize > 0 { - // a.QueueSize = queueSize - // } - //} - - //if k := key(ns, "process_queue_bytes"); config.Datadog.IsSet(k) { - // if queueBytes := config.Datadog.GetInt(k); queueBytes > 0 { - // a.ProcessQueueBytes = queueBytes - // } - //} - - //// The maximum number of processes, or containers per message. Note: Only change if the defaults are causing issues. - //if k := key(ns, "max_per_message"); config.Datadog.IsSet(k) { - // if maxPerMessage := config.Datadog.GetInt(k); maxPerMessage <= 0 { - // log.Warn("Invalid item count per message (<= 0), ignoring...") - // } else if maxPerMessage <= maxMessageBatch { - // a.MaxPerMessage = maxPerMessage - // } else if maxPerMessage > 0 { - // log.Warn("Overriding the configured item count per message limit because it exceeds maximum") - // } - //} - - //// The maximum number of processes belonging to a container per message. Note: Only change if the defaults are causing issues. - //if k := key(ns, "max_ctr_procs_per_message"); config.Datadog.IsSet(k) { - // if maxCtrProcessesPerMessage := config.Datadog.GetInt(k); maxCtrProcessesPerMessage <= 0 { - // log.Warnf("Invalid max container processes count per message (<= 0), using default value of %d", defaultMaxCtrProcsMessageBatch) - // } else if maxCtrProcessesPerMessage <= maxCtrProcsMessageBatch { - // a.MaxCtrProcessesPerMessage = maxCtrProcessesPerMessage - // } else { - // log.Warnf("Overriding the configured max container processes count per message limit because it exceeds maximum limit of %d", maxCtrProcsMessageBatch) - // } - //} - - //// Overrides the path to the Agent bin used for getting the hostname. The default is usually fine. + for _, b := range pc.BlacklistPatterns { + r, err := regexp.Compile(b) + if err != nil { + log.Warnf("Ignoring invalid blacklist pattern: %s", b) + continue + } + a.Blacklist = append(a.Blacklist, r) + } + + { + port := pc.ExpvarPort + if port <= 0 { + return errors.Errorf("invalid process_config.expvar_port -- %d", port) + } + a.ProcessExpVarPort = port + } + + // Enable/Disable the DataScrubber to obfuscate process args + a.Scrubber.Enabled = pc.ScrubArgs + + // A custom word list to enhance the default one used by the DataScrubber + if len(pc.CustomSensitiveWords) > 0 { + a.Scrubber.AddCustomSensitiveWords(pc.CustomSensitiveWords) + } + + // Strips all process arguments + a.Scrubber.StripAllArguments = pc.StripProcArguments + + // How many check results to buffer in memory when POST fails. The default is usually fine. + if queueSize := pc.QueueSize; queueSize > 0 { + a.QueueSize = queueSize + } + + if queueBytes := int(pc.QueueBytes.Value()); queueBytes > 0 { + a.ProcessQueueBytes = queueBytes + } + + // The maximum number of processes, or containers per message. Note: Only change if the defaults are causing issues. + if maxPerMessage := pc.MaxPerMessage; maxPerMessage <= 0 { + log.Warn("Invalid item count per message (<= 0), ignoring...") + } else if maxPerMessage <= maxMessageBatch { + a.MaxPerMessage = maxPerMessage + } else if maxPerMessage > 0 { + log.Warn("Overriding the configured item count per message limit because it exceeds maximum") + } + + // The maximum number of processes belonging to a container per message. Note: Only change if the defaults are causing issues. + if maxCtrProcessesPerMessage := pc.MaxCtrProcessesPerMessage; maxCtrProcessesPerMessage <= 0 { + log.Warnf("Invalid max container processes count per message (<= 0), using default value of %d", defaultMaxCtrProcsMessageBatch) + } else if maxCtrProcessesPerMessage <= maxCtrProcsMessageBatch { + a.MaxCtrProcessesPerMessage = maxCtrProcessesPerMessage + } else { + log.Warnf("Overriding the configured max container processes count per message limit because it exceeds maximum limit of %d", maxCtrProcsMessageBatch) + } + + // Overrides the path to the Agent bin used for getting the hostname. The default is usually fine. //a.DDAgentBin = defaultDDAgentBin //if k := key(ns, "dd_agent_bin"); config.Datadog.IsSet(k) { // if agentBin := config.Datadog.GetString(k); agentBin != "" { @@ -161,91 +130,75 @@ func (a *AgentConfig) LoadProcessYamlConfig(path string) error { // } //} - //// Overrides the grpc connection timeout setting to the main agent. - //if k := key(ns, "grpc_connection_timeout_secs"); config.Datadog.IsSet(k) { - // a.grpcConnectionTimeout = config.Datadog.GetDuration(k) * time.Second - //} - - //// Windows: Sets windows process table refresh rate (in number of check runs) - //if argRefresh := config.Datadog.GetInt(key(ns, "windows", "args_refresh_interval")); argRefresh != 0 { - // a.Windows.ArgsRefreshInterval = argRefresh - //} - - //// Windows: Controls getting process arguments immediately when a new process is discovered - //if addArgsKey := key(ns, "windows", "add_new_args"); config.Datadog.IsSet(addArgsKey) { - // a.Windows.AddNewArgs = config.Datadog.GetBool(addArgsKey) - //} - - //// Optional additional pairs of endpoint_url => []apiKeys to submit to other locations. - //if k := key(ns, "additional_endpoints"); config.Datadog.IsSet(k) { - // for endpointURL, apiKeys := range config.Datadog.GetStringMapStringSlice(k) { - // u, err := URL.Parse(endpointURL) - // if err != nil { - // return fmt.Errorf("invalid additional endpoint url '%s': %s", endpointURL, err) - // } - // for _, k := range apiKeys { - // a.APIEndpoints = append(a.APIEndpoints, apicfg.Endpoint{ - // APIKey: config.SanitizeAPIKey(k), - // Endpoint: u, - // }) - // } - // } - //} - - //// use `internal_profiling.enabled` field in `process_config` section to enable/disable profiling for process-agent, - //// but use the configuration from main agent to fill the settings - //if config.Datadog.IsSet(key(ns, "internal_profiling.enabled")) { - // a.ProfilingEnabled = config.Datadog.GetBool(key(ns, "internal_profiling.enabled")) - // a.ProfilingSite = config.Datadog.GetString("site") - // a.ProfilingURL = config.Datadog.GetString("internal_profiling.profile_dd_url") - // a.ProfilingEnvironment = config.Datadog.GetString("env") - // a.ProfilingPeriod = config.Datadog.GetDuration("internal_profiling.period") - // a.ProfilingCPUDuration = config.Datadog.GetDuration("internal_profiling.cpu_duration") - // a.ProfilingMutexFraction = config.Datadog.GetInt("internal_profiling.mutex_profile_fraction") - // a.ProfilingBlockRate = config.Datadog.GetInt("internal_profiling.block_profile_rate") - // a.ProfilingWithGoroutines = config.Datadog.GetBool("internal_profiling.enable_goroutine_stacktraces") - //} - - //// Used to override container source auto-detection - //// and to enable multiple collector sources if needed. - //// "docker", "ecs_fargate", "kubelet", "kubelet docker", etc. - //containerSourceKey := key(ns, "container_source") - //if config.Datadog.Get(containerSourceKey) != nil { - // // container_source can be nil since we're not forcing default values in the main config file - // // make sure we don't pass nil value to GetStringSlice to avoid spammy warnings - // if sources := config.Datadog.GetStringSlice(containerSourceKey); len(sources) > 0 { - // util.SetContainerSources(sources) - // } - //} - - //// Pull additional parameters from the global config file. - //if level := config.Datadog.GetString("log_level"); level != "" { - // a.LogLevel = level - //} - - //if k := "dogstatsd_port"; config.Datadog.IsSet(k) { - // a.StatsdPort = config.Datadog.GetInt(k) - //} - - //if bindHost := config.GetBindHost(); bindHost != "" { - // a.StatsdHost = bindHost - //} - - //// Build transport (w/ proxy if needed) - //a.Transport = httputils.CreateHTTPTransport() - - //return nil + // Overrides the grpc connection timeout setting to the main agent. + if timeout := pc.GrpcConnectionTimeout.Duration; timeout > 0 { + a.grpcConnectionTimeout = timeout + } + + // Windows: Sets windows process table refresh rate (in number of check runs) + a.Windows.ArgsRefreshInterval = pc.Windows.ArgsRefreshInterval + + // Windows: Controls getting process arguments immediately when a new process is discovered + a.Windows.AddNewArgs = pc.Windows.AddNewArgs + + // Optional additional pairs of endpoint_url => []apiKeys to submit to other locations. + for endpointURL, apiKeys := range pc.AdditionalEndpoints { + u, err := URL.Parse(endpointURL) + if err != nil { + return fmt.Errorf("invalid additional endpoint url '%s': %s", endpointURL, err) + } + for _, k := range apiKeys { + a.APIEndpoints = append(a.APIEndpoints, apicfg.Endpoint{ + APIKey: config.SanitizeAPIKey(k), + Endpoint: u, + }) + } + } + + // use `internal_profiling.enabled` field in `process_config` section to enable/disable profiling for process-agent, + // but use the configuration from main agent to fill the settings + { + c := &pc.InternalProfiling + if c.Enabled { + a.ProfilingEnabled = c.Enabled + a.ProfilingSite = c.Site + a.ProfilingURL = c.Url + a.ProfilingEnvironment = c.Env + a.ProfilingPeriod = c.Period.Duration + a.ProfilingCPUDuration = c.CpuDuration.Duration + a.ProfilingMutexFraction = c.MutexProfileFraction + a.ProfilingBlockRate = c.BlockProfileRate + a.ProfilingWithGoroutines = c.EnableGoroutineStacktraces + } + } + + // Used to override container source auto-detection + // and to enable multiple collector sources if needed. + // "docker", "ecs_fargate", "kubelet", "kubelet docker", etc. + // container_source can be nil since we're not forcing default values in the main config file + // make sure we don't pass nil value to GetStringSlice to avoid spammy warnings + if len(pc.ContainerSource) > 0 { + util.SetContainerSources(pc.ContainerSource) + } + + // Pull additional parameters from the global config file. + a.LogLevel = config.C.LogLevel + + a.StatsdPort = config.C.Statsd.Port + + if bindHost := config.C.GetBindHost(); bindHost != "" { + a.StatsdHost = bindHost + } + + // Build transport (w/ proxy if needed) + a.Transport = httputils.CreateHTTPTransport() + + return nil } -//func (a *AgentConfig) setCheckInterval(ns, check, checkKey string) { -// k := key(ns, "intervals", check) -// -// if !config.Datadog.IsSet(k) { -// return -// } -// -// if interval := config.Datadog.GetInt(k); interval != 0 { -// log.Infof("Overriding container check interval to %ds", interval) -// a.CheckIntervals[checkKey] = time.Duration(interval) * time.Second -// } -//} +func (a *AgentConfig) setCheckInterval(ns, checkKey string, interval time.Duration) { + if interval > 0 { + log.Infof("Overriding container check interval to %ds", interval.Seconds()) + a.CheckIntervals[checkKey] = interval + } +} diff --git a/staging/datadog-agent/pkg/process/util/api/weighted_queue.go b/staging/datadog-agent/pkg/process/util/api/weighted_queue.go index 6e282785..a70d1728 100644 --- a/staging/datadog-agent/pkg/process/util/api/weighted_queue.go +++ b/staging/datadog-agent/pkg/process/util/api/weighted_queue.go @@ -7,6 +7,7 @@ package api import ( "container/list" + "context" "sync" ) @@ -72,10 +73,10 @@ func (q *WeightedQueue) Weight() int64 { // Poll retrieves the head of the queue or blocks until an item is available. The provided exit channel can be closed // to interrupt the blocking operation. Returns the head of the queue and true or nil, false if the poll was // interrupted by the closing of the exit channel -func (q *WeightedQueue) Poll(exit chan struct{}) (WeightedItem, bool) { +func (q *WeightedQueue) Poll(ctx context.Context) (WeightedItem, bool) { for { select { - case <-exit: + case <-ctx.Done(): return nil, false default: @@ -90,7 +91,7 @@ func (q *WeightedQueue) Poll(exit chan struct{}) (WeightedItem, bool) { select { case <-q.dataAvailable: continue - case <-exit: + case <-ctx.Done(): return nil, false } } diff --git a/staging/datadog-agent/pkg/util/containers/providers/cgroup/cgroup_detect.go b/staging/datadog-agent/pkg/util/containers/providers/cgroup/cgroup_detect.go index 5919e904..c31dc494 100644 --- a/staging/datadog-agent/pkg/util/containers/providers/cgroup/cgroup_detect.go +++ b/staging/datadog-agent/pkg/util/containers/providers/cgroup/cgroup_detect.go @@ -3,6 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. +//go:build linux // +build linux package cgroup @@ -19,8 +20,8 @@ import ( "strconv" "strings" - "github.com/n9e/n9e-agentd/pkg/config" "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/n9e/n9e-agentd/pkg/config" ) var ( @@ -111,7 +112,7 @@ func cgroupMountPoints() (map[string]string, error) { } func parseCgroupMountPoints(r io.Reader) map[string]string { - cgroupRoot := config.Datadog.GetString("container_cgroup_root") + cgroupRoot := config.C.Container.CgroupRoot mountPoints := make(map[string]string) scanner := bufio.NewScanner(r) for scanner.Scan() { @@ -161,7 +162,7 @@ func scrapeAllCgroups() (map[string]*ContainerCgroup, error) { return cgs, err } - prefix := config.Datadog.GetString("container_cgroup_prefix") + prefix := config.C.Container.CgroupPrefix for _, dirName := range dirNames { pid, err := strconv.ParseInt(dirName, 10, 32) diff --git a/staging/datadog-agent/pkg/util/containers/providers/cgroup/common.go b/staging/datadog-agent/pkg/util/containers/providers/cgroup/common.go index 295f1048..bb0b1fc8 100644 --- a/staging/datadog-agent/pkg/util/containers/providers/cgroup/common.go +++ b/staging/datadog-agent/pkg/util/containers/providers/cgroup/common.go @@ -3,6 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. +//go:build linux // +build linux package cgroup @@ -46,7 +47,7 @@ func readLines(filename string) ([]string, error) { // hostProc returns the location of a host's procfs. This can and will be // overridden when running inside a container. func hostProc(combineWith ...string) string { - parts := append([]string{config.Datadog.GetString("container_proc_root")}, combineWith...) + parts := append([]string{config.C.ProcRoot}, combineWith...) return filepath.Join(parts...) } diff --git a/staging/datadog-agent/pkg/util/containers/providers/cgroup/network.go b/staging/datadog-agent/pkg/util/containers/providers/cgroup/network.go index 7b0dcd0d..8a52e26a 100644 --- a/staging/datadog-agent/pkg/util/containers/providers/cgroup/network.go +++ b/staging/datadog-agent/pkg/util/containers/providers/cgroup/network.go @@ -3,6 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. +//go:build linux // +build linux package cgroup @@ -17,10 +18,10 @@ import ( "strconv" "strings" - "github.com/n9e/n9e-agentd/pkg/config" "github.com/DataDog/datadog-agent/pkg/util/containers" "github.com/DataDog/datadog-agent/pkg/util/containers/metrics" "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/n9e/n9e-agentd/pkg/config" ) // collectNetworkStats retrieves the network statistics for a given pid. @@ -181,7 +182,7 @@ func defaultHostIPs() ([]string, error) { // The returned value would be ["enp0s3","00000000","0202000A","0003","0","0","0","00000000","0","0","0"] // func defaultGatewayFields() ([]string, error) { - procRoot := config.Datadog.GetString("proc_root") + procRoot := config.C.ProcRoot netRouteFile := filepath.Join(procRoot, "net", "route") f, err := os.Open(netRouteFile) if err != nil { diff --git a/staging/datadog-agent/pkg/util/containers/providers/cgroup/provider.go b/staging/datadog-agent/pkg/util/containers/providers/cgroup/provider.go index 50f38f2a..eab4d790 100644 --- a/staging/datadog-agent/pkg/util/containers/providers/cgroup/provider.go +++ b/staging/datadog-agent/pkg/util/containers/providers/cgroup/provider.go @@ -3,6 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2017-present Datadog, Inmetrics. +//go:build linux // +build linux package cgroup @@ -14,10 +15,10 @@ import ( "strconv" "sync" - "github.com/n9e/n9e-agentd/pkg/config" "github.com/DataDog/datadog-agent/pkg/util/containers" "github.com/DataDog/datadog-agent/pkg/util/containers/metrics" "github.com/DataDog/datadog-agent/pkg/util/containers/providers" + "github.com/n9e/n9e-agentd/pkg/config" ) // provider is a Cgroup implementation of the ContainerImplementation interface @@ -151,7 +152,7 @@ func (mp *provider) GetNetworkMetrics(containerID string, networks map[string]st // GetAgentCID returns the container ID where the current agent is running func (mp *provider) GetAgentCID() (string, error) { - prefix := config.Datadog.GetString("container_cgroup_prefix") + prefix := config.C.Container.CgroupPrefix cID, _, err := readCgroupsForPath("/proc/self/cgroup", prefix) if err != nil { return "", err @@ -177,7 +178,7 @@ func (mp *provider) GetPIDs(containerID string) ([]int32, error) { // containerd / cri-o default Kubernetes cgroups func (mp *provider) ContainerIDForPID(pid int) (string, error) { cgPath := hostProc(strconv.Itoa(pid), "cgroup") - prefix := config.Datadog.GetString("container_cgroup_prefix") + prefix := config.C.Container.CgroupPrefix containerID, _, err := readCgroupsForPath(cgPath, prefix)