From 9f72940958ef1412ef8625a6afff97cc05eb160a Mon Sep 17 00:00:00 2001 From: thediveo Date: Wed, 31 Jan 2024 13:37:07 +0000 Subject: [PATCH 1/7] refactor: replace dockertest with morbyd Signed-off-by: thediveo --- detector/containerd/containerd_test.go | 126 +++++++++++++------------ go.mod | 43 +++++---- go.sum | 102 +++++++++++--------- 3 files changed, 145 insertions(+), 126 deletions(-) diff --git a/detector/containerd/containerd_test.go b/detector/containerd/containerd_test.go index e4df3d3..405ccb1 100644 --- a/detector/containerd/containerd_test.go +++ b/detector/containerd/containerd_test.go @@ -7,16 +7,18 @@ package containerd import ( "context" "fmt" - "io" "os" "time" "github.com/containerd/containerd" - "github.com/ory/dockertest/v3" - "github.com/ory/dockertest/v3/docker" detect "github.com/siemens/turtlefinder/detector" "github.com/thediveo/go-plugger/v3" - "github.com/thediveo/whalewatcher/engineclient/containerd/test/ctr" + "github.com/thediveo/morbyd" + "github.com/thediveo/morbyd/build" + "github.com/thediveo/morbyd/exec" + "github.com/thediveo/morbyd/run" + "github.com/thediveo/morbyd/session" + "github.com/thediveo/morbyd/timestamper" "github.com/thediveo/whalewatcher/engineclient/cri/test/img" "github.com/thediveo/whalewatcher/test" @@ -37,9 +39,9 @@ const ( var _ = Describe("containerd turtle watcher", Ordered, func() { - var providerCntr *dockertest.Resource + var providerCntr *morbyd.Container - BeforeAll(func() { + BeforeAll(func(ctx context.Context) { if os.Getuid() != 0 { Skip("needs root") } @@ -52,9 +54,15 @@ var _ = Describe("containerd turtle watcher", Ordered, func() { Expect(Filedescriptors()).NotTo(HaveLeakedFds(goodfds)) }) + By("creating a new Docker session for testing") + sess := Successful(morbyd.NewSession(ctx, + session.WithAutoCleaning("test.turtlefinder=detector/containerd"))) + DeferCleanup(func(ctx context.Context) { + By("auto-cleaning the session") + sess.Close(ctx) + }) + By("spinning up a Docker container with stand-alone containerd, courtesy of the KinD k8s sig") - pool := Successful(dockertest.NewPool("unix:///run/docker.sock")) - _ = pool.RemoveContainerByName(kindischName) // The necessary container start arguments come from KinD's Docker node // provisioner, see: // https://github.com/kubernetes-sigs/kind/blob/3610f606516ccaa88aa098465d8c13af70937050/pkg/cluster/internal/providers/docker/provision.go#L133 @@ -75,47 +83,31 @@ var _ = Describe("containerd turtle watcher", Ordered, func() { // --volume /var // --volume /lib/modules:/lib/modules:ro // kindisch-... - Expect(pool.Client.BuildImage(docker.BuildImageOptions{ - Name: img.Name, - ContextDir: "./_test/kindisch", // sorry, couldn't resist the pun. - Dockerfile: "Dockerfile", - BuildArgs: []docker.BuildArg{ - {Name: "KINDEST_BASE_TAG", Value: test.KindestBaseImageTag}, - }, - OutputStream: io.Discard, - })).To(Succeed()) - providerCntr = Successful(pool.RunWithOptions( - &dockertest.RunOptions{ - Name: kindischName, - Repository: img.Name, - Privileged: true, - Mounts: []string{ - "/var", // well, this actually is an unnamed volume - "/dev/mapper:/dev/mapper", - "/lib/modules:/lib/modules:ro", - }, - Tty: true, - }, func(hc *docker.HostConfig) { - hc.Init = false - hc.Tmpfs = map[string]string{ - "/tmp": "", - "/run": "", - } - hc.Devices = []docker.Device{ - {PathOnHost: "/dev/fuse"}, - } - })) - DeferCleanup(func() { - By("removing the containerd Docker container") - Expect(pool.Purge(providerCntr)).To(Succeed()) - }) + Expect(sess.BuildImage(ctx, "./_test/kindisch", + build.WithTag(img.Name), + build.WithBuildArg("KINDEST_BASE_TAG="+test.KindestBaseImageTag), + build.WithOutput(timestamper.New(GinkgoWriter)))). + Error().NotTo(HaveOccurred()) + providerCntr = Successful(sess.Run(ctx, img.Name, + run.WithName(kindischName), + run.WithAutoRemove(), + run.WithPrivileged(), + run.WithSecurityOpt("label=disable"), + run.WithCgroupnsMode("private"), + run.WithVolume("/var"), + run.WithVolume("/dev/mapper:/dev/mapper"), + run.WithVolume("/lib/modules:/lib/modules:ro"), + run.WithTmpfs("/tmp"), + run.WithTmpfs("/run"), + run.WithDevice("/dev/fuse"), + run.WithCombinedOutput(timestamper.New(GinkgoWriter)))) By("waiting for containerized containerd to become responsive") - Expect(providerCntr.Container.State.Pid).NotTo(BeZero()) + pid := Successful(providerCntr.PID(ctx)) // apipath must not include absolute symbolic links, but already be // properly resolved. endpointPath := fmt.Sprintf("/proc/%d/root%s", - providerCntr.Container.State.Pid, "/run/containerd/containerd.sock") + pid, "/run/containerd/containerd.sock") var cdclient *containerd.Client Eventually(func() error { var err error @@ -139,29 +131,43 @@ var _ = Describe("containerd turtle watcher", Ordered, func() { It("watches successfully", NodeTimeout(30*time.Second), func(ctx context.Context) { By("pulling a busybox image (if necessary)") - ctr.Successfully(providerCntr, - "-n", testNamespace, - "image", "pull", testImageRef) + ctr := Successful(providerCntr.Exec(ctx, + exec.Command("ctr", + "-n", testNamespace, + "image", "pull", testImageRef), + exec.WithCombinedOutput(timestamper.New(GinkgoWriter)))) + Expect(ctr.Wait(ctx)).To(BeZero()) By("creating a new container+task and starting it") - ctr.Successfully(providerCntr, - "-n", testNamespace, - "run", "-d", - testImageRef, - testContainerName, - "/bin/sleep", "30s") - DeferCleanup(func() { - _ = ctr.Exec(providerCntr, - "-n", testNamespace, - "task", "rm", "-f", testContainerName) - _ = ctr.Exec(providerCntr, + ctr = Successful(providerCntr.Exec(ctx, + exec.Command("ctr", "-n", testNamespace, - "container", "rm", testContainerName) + "run", "-d", + testImageRef, + testContainerName, + "/bin/sleep", "30s"), + exec.WithCombinedOutput(timestamper.New(GinkgoWriter)))) + Expect(ctr.Wait(ctx)).To(BeZero()) + + DeferCleanup(func(ctx context.Context) { + ctr := Successful(providerCntr.Exec(ctx, + exec.Command("ctr", + "-n", testNamespace, + "task", "rm", "-f", testContainerName), + exec.WithCombinedOutput(timestamper.New(GinkgoWriter)))) + _, _ = ctr.Wait(ctx) + + ctr = Successful(providerCntr.Exec(ctx, + exec.Command("ctr", + "-n", testNamespace, + "container", "rm", testContainerName), + exec.WithCombinedOutput(timestamper.New(GinkgoWriter)))) + _, _ = ctr.Wait(ctx) }) By("running the detector on the API endpoints") d := &Detector{} - wormhole := fmt.Sprintf("/proc/%d/root", providerCntr.Container.State.Pid) + wormhole := fmt.Sprintf("/proc/%d/root", Successful(providerCntr.PID(ctx))) ws := d.NewWatchers(ctx, 0, []string{ wormhole + "/run/containerd/containerd.sock", }) diff --git a/go.mod b/go.mod index bc616c3..c9aec2c 100644 --- a/go.mod +++ b/go.mod @@ -3,17 +3,19 @@ module github.com/siemens/turtlefinder go 1.20 require ( - github.com/docker/docker v24.0.7+incompatible + github.com/docker/docker v25.0.1+incompatible github.com/google/uuid v1.5.0 - github.com/onsi/ginkgo/v2 v2.13.2 + github.com/onsi/ginkgo/v2 v2.15.0 github.com/sirupsen/logrus v1.9.3 + github.com/thediveo/morbyd v0.9.1 github.com/thediveo/procfsroot v1.0.1 - golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc + golang.org/x/exp v0.0.0-20240119083558-1b970713d09a golang.org/x/sync v0.6.0 k8s.io/cri-api v0.28.5 ) require ( + dario.cat/mergo v1.0.0 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect @@ -27,31 +29,34 @@ require ( github.com/containerd/log v0.1.0 // indirect github.com/containerd/ttrpc v1.2.2 // indirect github.com/containerd/typeurl/v2 v2.1.1 // indirect - github.com/docker/cli v24.0.2+incompatible // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11 // indirect + github.com/distribution/reference v0.5.0 // indirect + github.com/docker/cli v25.0.1+incompatible // indirect + github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/imdario/mergo v0.3.16 // indirect - github.com/klauspost/compress v1.16.6 // indirect + github.com/klauspost/compress v1.17.5 // indirect github.com/lib/pq v1.10.9 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/moby/buildkit v0.12.4 // indirect github.com/moby/locker v1.0.1 // indirect + github.com/moby/patternmatcher v0.6.0 // indirect github.com/moby/sys/mountinfo v0.6.2 // indirect github.com/moby/sys/sequential v0.5.0 // indirect github.com/moby/sys/signal v0.7.0 // indirect + github.com/moby/sys/user v0.1.0 // indirect github.com/moby/term v0.5.0 // indirect + github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/opencontainers/runc v1.1.7 // indirect - github.com/opencontainers/runtime-spec v1.1.0-rc.3 // indirect + github.com/opencontainers/runtime-spec v1.1.0 // indirect github.com/opencontainers/selinux v1.11.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/thediveo/go-mntinfo v1.0.2 // indirect @@ -60,10 +65,10 @@ require ( github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect - go.opentelemetry.io/otel v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.19.0 // indirect - go.opentelemetry.io/otel/trace v1.19.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect + go.opentelemetry.io/otel v1.22.0 // indirect + go.opentelemetry.io/otel/metric v1.22.0 // indirect + go.opentelemetry.io/otel/trace v1.22.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect @@ -76,18 +81,18 @@ require ( require ( github.com/cespare/xxhash/v2 v2.2.0 - github.com/containerd/containerd v1.7.11 - github.com/go-logr/logr v1.3.0 // indirect + github.com/containerd/containerd v1.7.12 + github.com/go-logr/logr v1.4.1 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // indirect - github.com/onsi/gomega v1.30.0 + github.com/onsi/gomega v1.31.1 github.com/ory/dockertest/v3 v3.10.0 github.com/thediveo/fdooze v0.3.1 github.com/thediveo/go-plugger/v3 v3.1.0 github.com/thediveo/lxkns v0.31.0 github.com/thediveo/success v1.0.2 github.com/thediveo/whalewatcher v0.11.0 - golang.org/x/net v0.19.0 // indirect + golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect - golang.org/x/tools v0.16.0 // indirect + golang.org/x/tools v0.17.0 // indirect ) diff --git a/go.sum b/go.sum index 301f7c0..fb18fc2 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA= @@ -6,7 +8,6 @@ github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0/go.mod github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= @@ -22,8 +23,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= -github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw= -github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE= +github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0= +github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk= github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY= @@ -38,14 +39,14 @@ github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/cli v24.0.2+incompatible h1:QdqR7znue1mtkXIJ+ruQMGQhpw2JzMJLRXp6zpzF6tM= -github.com/docker/cli v24.0.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= -github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11 h1:IPrmumsT9t5BS7XcPhgsCTlkWbYg80SEXUzDpReaU6Y= -github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11/go.mod h1:a6bNUGTbQBsY6VRHTr4h/rkOXjl244DyRD0tx3fgq4Q= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/cli v25.0.1+incompatible h1:mFpqnrS6Hsm3v1k7Wa/BO23oz0k121MTbTO1lpcGSkU= +github.com/docker/cli v25.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/docker v25.0.1+incompatible h1:k5TYd5rIVQRSqcTwCID+cyVA0yRg86+Pcrz1ls0/frA= +github.com/docker/docker v25.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -54,13 +55,13 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= -github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/gammazero/deque v0.2.1 h1:qSdsbG6pgp6nL7A0+K/B7s12mcCY/5l5SIUpMOl+dC0= github.com/gammazero/workerpool v1.1.3 h1:WixN4xzukFoN0XSeXF6puqEqFTl2mECI9S6W44HWy9Q= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= @@ -103,47 +104,51 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3 github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= -github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk= -github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E= +github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/buildkit v0.12.4 h1:yKZDsObXLKarXqUx7YMnaB+TKv810bBhq0XLFWbkjT0= +github.com/moby/buildkit v0.12.4/go.mod h1:XG74uz06nPWQpnxYwgCryrVidvor0+ElUxGosbZPQG4= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= +github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= +github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78= github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI= github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= +github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg= +github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= -github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs= -github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM= -github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= -github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= +github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= +github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= +github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/runc v1.1.7 h1:y2EZDS8sNng4Ksf0GUYNhKbTShZJPJg1FiXJNH/uoCk= github.com/opencontainers/runc v1.1.7/go.mod h1:CbUumNnWCuTGFukNXahoo/RFBZvDAgRh/smNYNOhA50= -github.com/opencontainers/runtime-spec v1.1.0-rc.3 h1:l04uafi6kxByhbxev7OWiuUv0LZxEsYUfDWZ6bztAuU= -github.com/opencontainers/runtime-spec v1.1.0-rc.3/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= +github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU= github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec= github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -153,13 +158,11 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -180,6 +183,8 @@ github.com/thediveo/ioctl v0.9.3 h1:DCxyUUY15z/Zezz+wf2nlbVf3yFh0nvfM7i7KnfgG8s= github.com/thediveo/ioctl v0.9.3/go.mod h1:Ro3WW0UuPDh1QByEwNb/alva3ODM+GbRlb80u/LZU9o= github.com/thediveo/lxkns v0.31.0 h1:vjUaMfYG+Xafep6L/QUDfU+xK+jpzrZQyG0OKQAnfhg= github.com/thediveo/lxkns v0.31.0/go.mod h1:agBgLaQTIIRC0+GzEzqdRxK4sihsZkvpp4Nsp10+Rl4= +github.com/thediveo/morbyd v0.9.1 h1:/YpyJsXzHJbYJ9qMYerNVUr0y/EEEBg5YpiEkqzdazU= +github.com/thediveo/morbyd v0.9.1/go.mod h1:DTGutlA9RC9yG2y1Gk0ZtJNOJ72Xp8BjJKmcf0mUxCw= github.com/thediveo/namspill v0.1.6 h1:eD8puqhwIkBS78vrzJtY46eurHX0o6JIAqzgkRmMLl0= github.com/thediveo/notwork v1.3.1 h1:KG1Jh7pWU+QTl+7yMzs2Zugl8JZsP0x4OwNFt0rItL0= github.com/thediveo/once v0.9.1 h1:gk/8dYOto5cVEBH0LK1vYyOFH9OvugcZ12e+UnJpmTo= @@ -203,20 +208,24 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= -go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= -go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= -go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= -go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= +go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= +go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 h1:FyjCyI9jVEfqhUh2MoSkmolPjfh5fp2hnV0b0irxH4Q= +go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= +go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= +go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= +go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= +go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= +go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= -golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= +golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -233,8 +242,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -245,10 +254,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -263,7 +270,7 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -272,8 +279,8 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -286,6 +293,7 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -317,7 +325,7 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/cri-api v0.28.5 h1:5TgjH4tbCqRJqtfkU/EInHNDCHfqI7b0oTqApBn23Lk= From 09db52aed3584030afc4f13c7ba6781b472a01eb Mon Sep 17 00:00:00 2001 From: thediveo Date: Wed, 31 Jan 2024 13:46:50 +0000 Subject: [PATCH 2/7] refactor: replace dockertest with morbyd Signed-off-by: thediveo --- detector/crio/crio_test.go | 85 +++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 47 deletions(-) diff --git a/detector/crio/crio_test.go b/detector/crio/crio_test.go index 0ae42e0..dd21990 100644 --- a/detector/crio/crio_test.go +++ b/detector/crio/crio_test.go @@ -7,16 +7,18 @@ package crio import ( "context" "fmt" - "io" "os" "time" "github.com/containerd/containerd" "github.com/google/uuid" - "github.com/ory/dockertest/v3" - "github.com/ory/dockertest/v3/docker" detect "github.com/siemens/turtlefinder/detector" "github.com/thediveo/go-plugger/v3" + "github.com/thediveo/morbyd" + "github.com/thediveo/morbyd/build" + "github.com/thediveo/morbyd/run" + "github.com/thediveo/morbyd/session" + "github.com/thediveo/morbyd/timestamper" criengine "github.com/thediveo/whalewatcher/engineclient/cri" "github.com/thediveo/whalewatcher/engineclient/cri/test/img" "github.com/thediveo/whalewatcher/test" @@ -41,9 +43,9 @@ const ( var _ = Describe("CRI-O turtle watcher", Ordered, func() { - var providerCntr *dockertest.Resource + var providerCntr *morbyd.Container - BeforeAll(func() { + BeforeAll(func(ctx context.Context) { if os.Getuid() != 0 { Skip("needs root") } @@ -56,9 +58,15 @@ var _ = Describe("CRI-O turtle watcher", Ordered, func() { Expect(Filedescriptors()).NotTo(HaveLeakedFds(goodfds)) }) + By("creating a new Docker session for testing") + sess := Successful(morbyd.NewSession(ctx, + session.WithAutoCleaning("test.turtlefinder=detector/crio"))) + DeferCleanup(func(ctx context.Context) { + By("auto-cleaning the session") + sess.Close(ctx) + }) + By("spinning up a Docker container with stand-alone CRI-O, courtesy of the KinD k8s sig and cri-o.io") - pool := Successful(dockertest.NewPool("unix:///run/docker.sock")) - _ = pool.RemoveContainerByName(kindischName) // The necessary container start arguments come from KinD's Docker node // provisioner, see: // https://github.com/kubernetes-sigs/kind/blob/3610f606516ccaa88aa098465d8c13af70937050/pkg/cluster/internal/providers/docker/provision.go#L133 @@ -79,47 +87,31 @@ var _ = Describe("CRI-O turtle watcher", Ordered, func() { // --volume /var // --volume /lib/modules:/lib/modules:ro // kindisch-... - Expect(pool.Client.BuildImage(docker.BuildImageOptions{ - Name: img.Name, - ContextDir: "./_test/kindisch", // sorry, couldn't resist the pun. - Dockerfile: "Dockerfile", - BuildArgs: []docker.BuildArg{ - {Name: "KINDEST_BASE_TAG", Value: test.KindestBaseImageTag}, - }, - OutputStream: io.Discard, - })).To(Succeed()) - providerCntr = Successful(pool.RunWithOptions( - &dockertest.RunOptions{ - Name: kindischName, - Repository: img.Name, - Privileged: true, - Mounts: []string{ - "/var", // well, this actually is an unnamed volume - "/dev/mapper:/dev/mapper", - "/lib/modules:/lib/modules:ro", - }, - Tty: true, - }, func(hc *docker.HostConfig) { - hc.Init = false - hc.Tmpfs = map[string]string{ - "/tmp": "", - "/run": "", - } - hc.Devices = []docker.Device{ - {PathOnHost: "/dev/fuse"}, - } - })) - DeferCleanup(func() { - By("removing the CRI-O Docker container") - Expect(pool.Purge(providerCntr)).To(Succeed()) - }) + Expect(sess.BuildImage(ctx, "./_test/kindisch", + build.WithTag(img.Name), + build.WithBuildArg("KINDEST_BASE_TAG="+test.KindestBaseImageTag), + build.WithOutput(timestamper.New(GinkgoWriter)))). + Error().NotTo(HaveOccurred()) + providerCntr = Successful(sess.Run(ctx, img.Name, + run.WithName(kindischName), + run.WithAutoRemove(), + run.WithPrivileged(), + run.WithSecurityOpt("label=disable"), + run.WithCgroupnsMode("private"), + run.WithVolume("/var"), + run.WithVolume("/dev/mapper:/dev/mapper"), + run.WithVolume("/lib/modules:/lib/modules:ro"), + run.WithTmpfs("/tmp"), + run.WithTmpfs("/run"), + run.WithDevice("/dev/fuse"), + run.WithCombinedOutput(timestamper.New(GinkgoWriter)))) By("waiting for containerized CRI-O to become responsive") - Expect(providerCntr.Container.State.Pid).NotTo(BeZero()) + pid := Successful(providerCntr.PID(ctx)) // apipath must not include absolute symbolic links, but already be // properly resolved. endpointPath := fmt.Sprintf("/proc/%d/root%s", - providerCntr.Container.State.Pid, "/run/crio/crio.sock") + pid, "/run/crio/crio.sock") var cdclient *containerd.Client Eventually(func() error { var err error @@ -145,11 +137,10 @@ var _ = Describe("CRI-O turtle watcher", Ordered, func() { var cricl *criengine.Client By("waiting for the CRI-O API to become responsive") - Expect(providerCntr.Container.State.Pid).NotTo(BeZero()) + pid := Successful(providerCntr.PID(ctx)) // apipath must not include absolute symbolic links, but already be // properly resolved. - endpoint := fmt.Sprintf("/proc/%d/root/run/crio/crio.sock", - providerCntr.Container.State.Pid) + endpoint := fmt.Sprintf("/proc/%d/root/run/crio/crio.sock", pid) Eventually(func() error { var err error cricl, err = criengine.New(endpoint, criengine.WithTimeout(1*time.Second)) @@ -232,7 +223,7 @@ var _ = Describe("CRI-O turtle watcher", Ordered, func() { By("running the detector on the API endpoints") d := &Detector{} - wormhole := fmt.Sprintf("/proc/%d/root", providerCntr.Container.State.Pid) + wormhole := fmt.Sprintf("/proc/%d/root", pid) ws := d.NewWatchers(ctx, 0, []string{ wormhole + "/run/crio/crio.sock", }) From 4087ca1ae543d6f232d94b8469021d7fa20e892f Mon Sep 17 00:00:00 2001 From: thediveo Date: Wed, 31 Jan 2024 20:53:54 +0000 Subject: [PATCH 3/7] refactor: replace dockertest with morbyd Signed-off-by: thediveo --- _test/pind/Dockerfile | 1 + daemonfinder_test.go | 3 +- detector/containerd/containerd_test.go | 3 - detector/crio/crio_test.go | 3 - detector/moby/moby_test.go | 34 +++++---- engine_test.go | 29 ++++--- go.mod | 12 --- go.sum | 16 ---- socketactivator_test.go | 3 +- stacker_test.go | 102 ++++++++++++------------- turtlefinder_test.go | 93 ++++++++++------------ 11 files changed, 129 insertions(+), 170 deletions(-) diff --git a/_test/pind/Dockerfile b/_test/pind/Dockerfile index bf0b1a1..24eb0dd 100644 --- a/_test/pind/Dockerfile +++ b/_test/pind/Dockerfile @@ -7,5 +7,6 @@ RUN dnf -y install \ --exclude container-selinux && \ dnf clean all && \ rm -rf /var/cache /var/log/dnf* /var/log/yum.* && \ + systemctl mask systemd-logind.service getty.service getty.target && \ systemctl enable podman.socket CMD [ "/usr/sbin/init" ] diff --git a/daemonfinder_test.go b/daemonfinder_test.go index 44adb4d..9d37df8 100644 --- a/daemonfinder_test.go +++ b/daemonfinder_test.go @@ -14,9 +14,10 @@ import ( "strings" "time" + "github.com/thediveo/lxkns/model" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/thediveo/lxkns/model" . "github.com/thediveo/success" ) diff --git a/detector/containerd/containerd_test.go b/detector/containerd/containerd_test.go index 405ccb1..ec0a149 100644 --- a/detector/containerd/containerd_test.go +++ b/detector/containerd/containerd_test.go @@ -69,9 +69,6 @@ var _ = Describe("containerd turtle watcher", Ordered, func() { // // Please note that --privileged already implies switching off AppArmor. // - // Please note further, that currently some Docker client CLI flags - // don't translate into dockertest-supported options. - // // docker run -it --rm --name kindisch-... // --privileged // --cgroupns=private diff --git a/detector/crio/crio_test.go b/detector/crio/crio_test.go index dd21990..1ab991d 100644 --- a/detector/crio/crio_test.go +++ b/detector/crio/crio_test.go @@ -73,9 +73,6 @@ var _ = Describe("CRI-O turtle watcher", Ordered, func() { // // Please note that --privileged already implies switching off AppArmor. // - // Please note further, that currently some Docker client CLI flags - // don't translate into dockertest-supported options. - // // docker run -it --rm --name kindisch-... // --privileged // --cgroupns=private diff --git a/detector/moby/moby_test.go b/detector/moby/moby_test.go index 4673ffb..cbfb49c 100644 --- a/detector/moby/moby_test.go +++ b/detector/moby/moby_test.go @@ -11,8 +11,11 @@ import ( detect "github.com/siemens/turtlefinder/detector" - "github.com/ory/dockertest/v3" "github.com/thediveo/go-plugger/v3" + "github.com/thediveo/morbyd" + "github.com/thediveo/morbyd/run" + "github.com/thediveo/morbyd/session" + "github.com/thediveo/morbyd/timestamper" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -32,28 +35,27 @@ const goroutinesUnwindPolling = 250 * time.Millisecond var _ = Describe("Docker detector", Ordered, func() { - var pool *dockertest.Pool + var sess *morbyd.Session - BeforeAll(timeout, func(_ context.Context) { + BeforeAll(timeout, func(ctx context.Context) { if os.Getuid() != 0 { Skip("needs root") } - By("cleaning up any leftovers") - pool = Successful(dockertest.NewPool("")) - _ = pool.RemoveContainerByName(testWorkloadName) + By("creating a new Docker session for testing") + sess = Successful(morbyd.NewSession(ctx, + session.WithAutoCleaning("test.turtlefinder=detector/moby"))) + DeferCleanup(func(ctx context.Context) { + By("auto-cleaning the session") + sess.Close(ctx) + }) By("creating a test workload") - Expect(pool.RunWithOptions(&dockertest.RunOptions{ - Repository: "busybox", - Tag: "latest", - Name: testWorkloadName, - Cmd: []string{"/bin/sleep", "120s"}, - })).Error().NotTo(HaveOccurred(), - "creating container %s", testWorkloadName) - DeferCleanup(timeout, func(_ context.Context) { - _ = pool.RemoveContainerByName(testWorkloadName) - }) + Expect(sess.Run(ctx, "busybox", + run.WithName(testWorkloadName), + run.WithAutoRemove(), + run.WithCommand("/bin/sh", "-c", "while true; do sleep 1; done"), + run.WithCombinedOutput(timestamper.New(GinkgoWriter)))).Error().NotTo(HaveOccurred()) }) BeforeEach(timeout, func(_ context.Context) { diff --git a/engine_test.go b/engine_test.go index 43a083c..978e148 100644 --- a/engine_test.go +++ b/engine_test.go @@ -9,7 +9,10 @@ import ( "time" "github.com/onsi/gomega/types" - "github.com/ory/dockertest/v3" + "github.com/thediveo/morbyd" + "github.com/thediveo/morbyd/run" + "github.com/thediveo/morbyd/session" + "github.com/thediveo/morbyd/timestamper" "github.com/thediveo/whalewatcher/watcher/moby" "github.com/siemens/turtlefinder/internal/test" @@ -19,6 +22,7 @@ import ( . "github.com/onsi/gomega/gleak" . "github.com/siemens/turtlefinder/matcher" . "github.com/thediveo/fdooze" + . "github.com/thediveo/success" ) // testEngineWorkloadName specifies the name of a Docker container test @@ -55,17 +59,20 @@ var _ = Describe("container engine", Serial, Ordered, func() { Consistently(engine.IsAlive).Should(BeTrue()) - pool, err := dockertest.NewPool("") - Expect(err).NotTo(HaveOccurred()) - _ = pool.RemoveContainerByName(testEngineWorkloadName) - _, err = pool.RunWithOptions(&dockertest.RunOptions{ - Repository: "busybox", - Tag: "latest", - Name: testEngineWorkloadName, - Cmd: []string{"/bin/sleep", "120s"}, + By("creating a new Docker session for testing") + sess := Successful(morbyd.NewSession(ctx, + session.WithAutoCleaning("test.turtlefinder=turtlefinder"))) + DeferCleanup(func(ctx context.Context) { + By("auto-cleaning the session") + sess.Close(ctx) }) - Expect(err).NotTo(HaveOccurred(), "creating container %s", testEngineWorkloadName) - defer func() { _ = pool.RemoveContainerByName(testEngineWorkloadName) }() + + By("creating a canary container") + _ = Successful(sess.Run(ctx, "busybox", + run.WithName(testEngineWorkloadName), + run.WithAutoRemove(), + run.WithCommand("/bin/sh", "-c", "while true; do sleep 1; done"), + run.WithCombinedOutput(timestamper.New(GinkgoWriter)))) // Give leeway for the container workload discovery to reflect the // correct situation even under heavy system load. And remember to pass diff --git a/go.mod b/go.mod index c9aec2c..b785322 100644 --- a/go.mod +++ b/go.mod @@ -15,13 +15,11 @@ require ( ) require ( - dario.cat/mergo v1.0.0 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Microsoft/hcsshim v0.11.4 // indirect - github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/containerd/cgroups v1.1.0 // indirect github.com/containerd/continuity v0.4.2 // indirect @@ -30,7 +28,6 @@ require ( github.com/containerd/ttrpc v1.2.2 // indirect github.com/containerd/typeurl/v2 v2.1.1 // indirect github.com/distribution/reference v0.5.0 // indirect - github.com/docker/cli v25.0.1+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect github.com/docker/go-units v0.5.0 // indirect @@ -40,10 +37,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/klauspost/compress v1.17.5 // indirect - github.com/lib/pq v1.10.9 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/buildkit v0.12.4 // indirect github.com/moby/locker v1.0.1 // indirect github.com/moby/patternmatcher v0.6.0 // indirect @@ -55,15 +49,11 @@ require ( github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc5 // indirect - github.com/opencontainers/runc v1.1.7 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect github.com/opencontainers/selinux v1.11.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/thediveo/go-mntinfo v1.0.2 // indirect github.com/thediveo/ioctl v0.9.3 // indirect - github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect - github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect - github.com/xeipuuv/gojsonschema v1.2.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect go.opentelemetry.io/otel v1.22.0 // indirect @@ -75,7 +65,6 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect google.golang.org/grpc v1.60.1 // indirect google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -86,7 +75,6 @@ require ( github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // indirect github.com/onsi/gomega v1.31.1 - github.com/ory/dockertest/v3 v3.10.0 github.com/thediveo/fdooze v0.3.1 github.com/thediveo/go-plugger/v3 v3.1.0 github.com/thediveo/lxkns v0.31.0 diff --git a/go.sum b/go.sum index fb18fc2..4fdc552 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA= @@ -13,7 +12,6 @@ github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5 github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -42,7 +40,6 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/cli v25.0.1+incompatible h1:mFpqnrS6Hsm3v1k7Wa/BO23oz0k121MTbTO1lpcGSkU= -github.com/docker/cli v25.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v25.0.1+incompatible h1:k5TYd5rIVQRSqcTwCID+cyVA0yRg86+Pcrz1ls0/frA= github.com/docker/docker v25.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= @@ -64,7 +61,6 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -100,7 +96,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 h1:hR7/MlvK23p6+lIw9SN1TigNLn9ZnF3W4SYRKq2gAHs= github.com/google/pprof v0.0.0-20230602150820-91b7bce49751/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -111,10 +106,7 @@ github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPq github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= -github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/buildkit v0.12.4 h1:yKZDsObXLKarXqUx7YMnaB+TKv810bBhq0XLFWbkjT0= github.com/moby/buildkit v0.12.4/go.mod h1:XG74uz06nPWQpnxYwgCryrVidvor0+ElUxGosbZPQG4= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= @@ -142,13 +134,11 @@ github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3I github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/runc v1.1.7 h1:y2EZDS8sNng4Ksf0GUYNhKbTShZJPJg1FiXJNH/uoCk= -github.com/opencontainers/runc v1.1.7/go.mod h1:CbUumNnWCuTGFukNXahoo/RFBZvDAgRh/smNYNOhA50= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU= github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec= github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= -github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -166,7 +156,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -197,13 +186,9 @@ github.com/thediveo/whalewatcher v0.11.0 h1:TwCVo6YSHnyu3GSFNbY/VnU8fdMba8XIBloO github.com/thediveo/whalewatcher v0.11.0/go.mod h1:GfjSmFHT+MccFjFR48+KVCJZcEe2BG1ZQ7essnREWTM= github.com/vishvananda/netlink v1.2.1-beta.2.0.20230206183746-70ca0345eede h1:S+/0qI1RT0iW4moxdCoopW5JvXWU9pbJXM96IElhDF0= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f h1:p4VB7kIXpOQvVn1ZaTIVp+3vuYAXFe3OJEvjbUYJLaA= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= @@ -321,7 +306,6 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/socketactivator_test.go b/socketactivator_test.go index c21e6a8..e7d5f32 100644 --- a/socketactivator_test.go +++ b/socketactivator_test.go @@ -10,11 +10,10 @@ import ( "sync" "time" + "github.com/siemens/turtlefinder/internal/test" "github.com/thediveo/lxkns/model" "github.com/thediveo/whalewatcher/watcher" - "github.com/siemens/turtlefinder/internal/test" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gleak" diff --git a/stacker_test.go b/stacker_test.go index 464377c..b6e6a4e 100644 --- a/stacker_test.go +++ b/stacker_test.go @@ -6,17 +6,19 @@ package turtlefinder import ( "context" - "io" "os" "strings" "time" - "github.com/ory/dockertest/v3" - "github.com/ory/dockertest/v3/docker" "github.com/thediveo/lxkns/discover" "github.com/thediveo/lxkns/model" "github.com/thediveo/lxkns/species" - "github.com/thediveo/whalewatcher/engineclient/containerd/test/ctr" + "github.com/thediveo/morbyd" + "github.com/thediveo/morbyd/build" + "github.com/thediveo/morbyd/exec" + "github.com/thediveo/morbyd/run" + "github.com/thediveo/morbyd/session" + "github.com/thediveo/morbyd/timestamper" "github.com/thediveo/whalewatcher/engineclient/cri" "github.com/thediveo/whalewatcher/engineclient/cri/test/img" "github.com/thediveo/whalewatcher/test" @@ -94,19 +96,21 @@ var _ = Describe("turtles and elephants", Serial, Ordered, func() { HaveEngine(containerd.Type, `^unix:///proc/\d+/root/run/containerd/containerd.sock$`), )) - By("starting an additional container engine in a container") + By("creating a new Docker session for testing") + sess := Successful(morbyd.NewSession(ctx, + session.WithAutoCleaning("test.turtlefinder=detector/containerd"))) + DeferCleanup(func(ctx context.Context) { + By("auto-cleaning the session") + sess.Close(ctx) + }) + By("spinning up a Docker container with stand-alone containerd, courtesy of the KinD k8s sig") - pool := Successful(dockertest.NewPool("unix:///run/docker.sock")) - _ = pool.RemoveContainerByName(kindischName) // The necessary container start arguments come from KinD's Docker node // provisioner, see: // https://github.com/kubernetes-sigs/kind/blob/3610f606516ccaa88aa098465d8c13af70937050/pkg/cluster/internal/providers/docker/provision.go#L133 // // Please note that --privileged already implies switching off AppArmor. // - // Please note further, that currently some Docker client CLI flags - // don't translate into dockertest-supported options. - // // docker run -it --rm --name kindisch-... // --privileged // --cgroupns=private @@ -118,40 +122,24 @@ var _ = Describe("turtles and elephants", Serial, Ordered, func() { // --volume /var // --volume /lib/modules:/lib/modules:ro // kindisch-... - Expect(pool.Client.BuildImage(docker.BuildImageOptions{ - Name: img.Name, - ContextDir: "./detector/containerd/_test/kindisch", // sorry, couldn't resist the pun. - Dockerfile: "Dockerfile", - BuildArgs: []docker.BuildArg{ - {Name: "KINDEST_BASE_TAG", Value: test.KindestBaseImageTag}, - }, - OutputStream: io.Discard, - })).To(Succeed()) - providerCntr := Successful(pool.RunWithOptions( - &dockertest.RunOptions{ - Name: kindischName, - Repository: img.Name, - Privileged: true, - Mounts: []string{ - "/var", // well, this actually is an unnamed volume - "/dev/mapper:/dev/mapper", - "/lib/modules:/lib/modules:ro", - }, - Tty: true, - }, func(hc *docker.HostConfig) { - hc.Init = false - hc.Tmpfs = map[string]string{ - "/tmp": "", - "/run": "", - } - hc.Devices = []docker.Device{ - {PathOnHost: "/dev/fuse"}, - } - })) - DeferCleanup(func() { - By("removing the containerd Docker container") - _ = pool.Purge(providerCntr) - }) + Expect(sess.BuildImage(ctx, "./detector/containerd/_test/kindisch", + build.WithTag(img.Name), + build.WithBuildArg("KINDEST_BASE_TAG="+test.KindestBaseImageTag), + build.WithOutput(timestamper.New(GinkgoWriter)))). + Error().NotTo(HaveOccurred()) + providerCntr := Successful(sess.Run(ctx, img.Name, + run.WithName(kindischName), + run.WithAutoRemove(), + run.WithPrivileged(), + run.WithSecurityOpt("label=disable"), + run.WithCgroupnsMode("private"), + run.WithVolume("/var"), + run.WithVolume("/dev/mapper:/dev/mapper"), + run.WithVolume("/lib/modules:/lib/modules:ro"), + run.WithTmpfs("/tmp"), + run.WithTmpfs("/run"), + run.WithDevice("/dev/fuse"), + run.WithCombinedOutput(timestamper.New(GinkgoWriter)))) // This basically tests that scans correctly detect the newly // starting/started containerd process and start two watchers for it: @@ -174,17 +162,23 @@ var _ = Describe("turtles and elephants", Serial, Ordered, func() { )) By("pulling a busybox image (if necessary)") - ctr.Successfully(providerCntr, - "-n", testNamespace, - "image", "pull", testImageRef) + ctr := Successful(providerCntr.Exec(ctx, + exec.Command("ctr", + "-n", testNamespace, + "image", "pull", testImageRef), + exec.WithCombinedOutput(timestamper.New(GinkgoWriter)))) + Expect(ctr.Wait(ctx)).To(BeZero()) By("creating a new container+task and starting it") - ctr.Successfully(providerCntr, - "-n", testNamespace, - "run", "-d", - testImageRef, - testContainerName, - "/bin/sleep", "30s") + ctr = Successful(providerCntr.Exec(ctx, + exec.Command("ctr", + "-n", testNamespace, + "run", "-d", + testImageRef, + testContainerName, + "/bin/sleep", "30s"), + exec.WithCombinedOutput(timestamper.New(GinkgoWriter)))) + Expect(ctr.Wait(ctx)).To(BeZero()) Eventually(func() model.Containers { return discover().Containers @@ -197,7 +191,7 @@ var _ = Describe("turtles and elephants", Serial, Ordered, func() { HaveKeyWithValue(TurtlefinderContainerPrefixLabelName, kindischName))))) By("stopping the containerized container engine") - Expect(pool.Purge(providerCntr)).To(Succeed()) + providerCntr.Kill(ctx) By("waiting for the containerized containerd engine to vanish") Eventually(ctx, func() []*model.ContainerEngine { diff --git a/turtlefinder_test.go b/turtlefinder_test.go index db14f41..28627d4 100644 --- a/turtlefinder_test.go +++ b/turtlefinder_test.go @@ -7,22 +7,24 @@ package turtlefinder import ( "context" "fmt" - "io" "os" "sync" "time" - "github.com/ory/dockertest/v3" - "github.com/ory/dockertest/v3/docker" + "github.com/siemens/turtlefinder/activator/podman" + "github.com/siemens/turtlefinder/internal/test" "github.com/siemens/turtlefinder/matcher" "github.com/thediveo/lxkns/discover" "github.com/thediveo/lxkns/model" + "github.com/thediveo/morbyd" + "github.com/thediveo/morbyd/build" + "github.com/thediveo/morbyd/exec" + "github.com/thediveo/morbyd/run" + "github.com/thediveo/morbyd/session" + "github.com/thediveo/morbyd/timestamper" "github.com/thediveo/whalewatcher/watcher/containerd" "github.com/thediveo/whalewatcher/watcher/moby" - "github.com/siemens/turtlefinder/activator/podman" - "github.com/siemens/turtlefinder/internal/test" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gleak" @@ -45,9 +47,9 @@ const ( var _ = Describe("turtle finder", Ordered, Serial, func() { - var pindCntr *dockertest.Resource + var pindCntr *morbyd.Container - BeforeAll(func() { + BeforeAll(func(ctx context.Context) { if os.Getuid() != 0 { Skip("needs root") } @@ -60,9 +62,15 @@ var _ = Describe("turtle finder", Ordered, Serial, func() { Expect(Filedescriptors()).NotTo(HaveLeakedFds(goodfds)) }) + By("creating a new Docker session for testing") + sess := Successful(morbyd.NewSession(ctx, + session.WithAutoCleaning("test.turtlefinder=turtlefinder"))) + DeferCleanup(func(ctx context.Context) { + By("auto-cleaning the session") + sess.Close(ctx) + }) + By("spinning up a Docker container with a podman system demon^Wservice") - pool := Successful(dockertest.NewPool("unix:///run/docker.sock")) - _ = pool.RemoveContainerByName(pindName) // The necessary container start arguments loosely base on // https://www.redhat.com/sysadmin/podman-inside-container but had to be // heavily modified because they didn't work out as is, for whatever @@ -84,39 +92,22 @@ var _ = Describe("turtle finder", Ordered, Serial, func() { // // Please note that the initial build of the podman-in-Docker image is // really slow, as fedora installs lots of things. - Expect(pool.Client.BuildImage(docker.BuildImageOptions{ - Name: pindImageName, - ContextDir: "./_test/pind", // sorry, couldn't resist the pun. - Dockerfile: "Dockerfile", - BuildArgs: []docker.BuildArg{ - {Name: "FEDORA_TAG", Value: fedoraTag}, - }, - OutputStream: io.Discard, - })).To(Succeed()) - pindCntr = Successful(pool.RunWithOptions( - &dockertest.RunOptions{ - Name: pindName, - Repository: pindImageName, - Privileged: true, - Mounts: []string{ - "/var", // well, this actually is an unnamed volume - }, - Tty: true, - }, func(hc *docker.HostConfig) { - hc.Init = false - hc.Tmpfs = map[string]string{ - "/tmp": "", - "/run": "", - } - hc.Devices = []docker.Device{ - {PathOnHost: "/dev/fuse"}, - } - })) - DeferCleanup(func() { - By("removing the podman-in-Docker container") - Expect(pool.Purge(pindCntr)).To(Succeed()) - }) - + Expect(sess.BuildImage(ctx, "./_test/pind", + build.WithTag(pindImageName), + build.WithBuildArg("FEDORA_TAG="+fedoraTag), + build.WithOutput(timestamper.New(GinkgoWriter)))). + Error().NotTo(HaveOccurred()) + pindCntr = Successful(sess.Run(ctx, pindImageName, + run.WithName(pindName), + run.WithAutoRemove(), + run.WithPrivileged(), + run.WithSecurityOpt("label=disable"), + run.WithCgroupnsMode("private"), + run.WithVolume("/var"), + run.WithTmpfs("/tmp"), + run.WithTmpfs("/run"), + run.WithDevice("/dev/fuse"), + run.WithCombinedOutput(timestamper.New(GinkgoWriter)))) }) BeforeEach(clearCachedDetectorPlugins) @@ -193,19 +184,17 @@ var _ = Describe("turtle finder", Ordered, Serial, func() { )) By("checking for the presence of our dedicated podman-in-Docker engine instance...") + pid := Successful(pindCntr.PID(ctx)) Expect(tf.Engines()).To(ContainElement( - HaveEngine(podman.Type, fmt.Sprintf(`^unix:///proc/%d/root/run/podman/podman.sock$`, pindCntr.Container.State.Pid)), + HaveEngine(podman.Type, fmt.Sprintf(`^unix:///proc/%d/root/run/podman/podman.sock$`, pid)), ), "missing podman-in-Docker engine") By("creating podman workload") - exitcode, err := pindCntr.Exec([]string{ - "podman", "run", "-d", "-it" /*!!!?*/, "--rm", "--name", canaryContainerName, "--net", "host", canaryImageRef, - }, dockertest.ExecOptions{ - StdOut: GinkgoWriter, - StdErr: GinkgoWriter, - }) - Expect(err).NotTo(HaveOccurred()) - Expect(exitcode).To(BeZero()) + pmCmd := Successful(pindCntr.Exec(ctx, + exec.Command("podman", "run", "-d", "-it", "--rm", + "--name", canaryContainerName, "--net", "host", canaryImageRef), + exec.WithCombinedOutput(timestamper.New(GinkgoWriter)))) + Expect(pmCmd.Wait(ctx)).To(BeZero()) By("discovering podman workload and its managing podman engine hierarchy") Eventually(func() []*model.Container { From cfbd9e65e44a14a335fd3e1787eae82c66c92a4b Mon Sep 17 00:00:00 2001 From: thediveo Date: Wed, 31 Jan 2024 21:10:09 +0000 Subject: [PATCH 4/7] fix: leaked go routine when context already done before engine synchronization Signed-off-by: thediveo --- watch.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/watch.go b/watch.go index 43af451..24d613d 100644 --- a/watch.go +++ b/watch.go @@ -59,7 +59,12 @@ func startWatch(ctx context.Context, w watcher.Watcher, maxwait time.Duration) { // case of a synchronization or other error, so this transient go routine is // bound to terminate for any outcome sooner or later. go func() { - <-w.Ready() + select { + case <-w.Ready(): + // fall through + case <-ctx.Done(): + return // avoid leaking this go routine when ctx already done. + } // Getting the engine ID should be carried out swiftly, so we timebox // it. idctx, idcancel := context.WithTimeout(ctx, 2*time.Second) From 59953752c3bc3114a2a795d436568ed1cb14e60e Mon Sep 17 00:00:00 2001 From: thediveo Date: Fri, 2 Feb 2024 20:38:47 +0100 Subject: [PATCH 5/7] chore: bump up deps, finishing dockertest replacement Signed-off-by: thediveo --- go.mod | 32 +++++++++++++------------- go.sum | 72 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/go.mod b/go.mod index b785322..eadeba2 100644 --- a/go.mod +++ b/go.mod @@ -3,26 +3,26 @@ module github.com/siemens/turtlefinder go 1.20 require ( - github.com/docker/docker v25.0.1+incompatible - github.com/google/uuid v1.5.0 + github.com/docker/docker v25.0.2+incompatible + github.com/google/uuid v1.6.0 github.com/onsi/ginkgo/v2 v2.15.0 github.com/sirupsen/logrus v1.9.3 - github.com/thediveo/morbyd v0.9.1 + github.com/thediveo/morbyd v0.9.2 github.com/thediveo/procfsroot v1.0.1 golang.org/x/exp v0.0.0-20240119083558-1b970713d09a golang.org/x/sync v0.6.0 - k8s.io/cri-api v0.28.5 + k8s.io/cri-api v0.28.6 ) require ( github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect - github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect + github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20231105174938-2b5cbb29f3e2 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Microsoft/hcsshim v0.11.4 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/containerd/cgroups v1.1.0 // indirect - github.com/containerd/continuity v0.4.2 // indirect + github.com/containerd/continuity v0.4.3 // indirect github.com/containerd/fifo v1.1.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/ttrpc v1.2.2 // indirect @@ -38,17 +38,17 @@ require ( github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/klauspost/compress v1.17.5 // indirect - github.com/moby/buildkit v0.12.4 // indirect + github.com/moby/buildkit v0.12.5 // indirect github.com/moby/locker v1.0.1 // indirect github.com/moby/patternmatcher v0.6.0 // indirect - github.com/moby/sys/mountinfo v0.6.2 // indirect + github.com/moby/sys/mountinfo v0.7.1 // indirect github.com/moby/sys/sequential v0.5.0 // indirect github.com/moby/sys/signal v0.7.0 // indirect github.com/moby/sys/user v0.1.0 // indirect github.com/moby/term v0.5.0 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc5 // indirect + github.com/opencontainers/image-spec v1.1.0-rc6 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect github.com/opencontainers/selinux v1.11.0 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -61,25 +61,25 @@ require ( go.opentelemetry.io/otel/trace v1.22.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/grpc v1.60.1 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect + google.golang.org/grpc v1.61.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) require ( github.com/cespare/xxhash/v2 v2.2.0 - github.com/containerd/containerd v1.7.12 + github.com/containerd/containerd v1.7.13 github.com/go-logr/logr v1.4.1 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 // indirect github.com/onsi/gomega v1.31.1 github.com/thediveo/fdooze v0.3.1 github.com/thediveo/go-plugger/v3 v3.1.0 - github.com/thediveo/lxkns v0.31.0 + github.com/thediveo/lxkns v0.32.4 github.com/thediveo/success v1.0.2 - github.com/thediveo/whalewatcher v0.11.0 + github.com/thediveo/whalewatcher v0.11.1 golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/tools v0.17.0 // indirect diff --git a/go.sum b/go.sum index 4fdc552..50bd9e3 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= -github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA= -github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0/go.mod h1:OahwfttHWG6eJ0clwcfBAHoDI6X/LV/15hx/wlMZSrU= +github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20231105174938-2b5cbb29f3e2 h1:dIScnXFlF784X79oi7MzVT6GWqr/W1uUt0pB5CsDs9M= +github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20231105174938-2b5cbb29f3e2/go.mod h1:gCLVsLfv1egrcZu+GoJATN5ts75F2s62ih/457eWzOw= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -21,10 +20,10 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= -github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0= -github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk= -github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= -github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/containerd v1.7.13 h1:wPYKIeGMN8vaggSKuV1X0wZulpMz4CrgEsZdaCyB6Is= +github.com/containerd/containerd v1.7.13/go.mod h1:zT3up6yTRfEUa6+GsITYIJNgSVL9NQ4x4h1RPzk0Wu4= +github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= +github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY= github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= @@ -39,9 +38,9 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v25.0.1+incompatible h1:mFpqnrS6Hsm3v1k7Wa/BO23oz0k121MTbTO1lpcGSkU= -github.com/docker/docker v25.0.1+incompatible h1:k5TYd5rIVQRSqcTwCID+cyVA0yRg86+Pcrz1ls0/frA= -github.com/docker/docker v25.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/cli v24.0.4+incompatible h1:Y3bYF9ekNTm2VFz5U/0BlMdJy73D+Y1iAAZ8l63Ydzw= +github.com/docker/docker v25.0.2+incompatible h1:/OaKeauroa10K4Nqavw4zlhcDq/WBcPMc5DbjOGgozY= +github.com/docker/docker v25.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= @@ -97,9 +96,10 @@ github.com/google/pprof v0.0.0-20230602150820-91b7bce49751 h1:hR7/MlvK23p6+lIw9S github.com/google/pprof v0.0.0-20230602150820-91b7bce49751/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E= @@ -107,14 +107,14 @@ github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6K github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/moby/buildkit v0.12.4 h1:yKZDsObXLKarXqUx7YMnaB+TKv810bBhq0XLFWbkjT0= -github.com/moby/buildkit v0.12.4/go.mod h1:XG74uz06nPWQpnxYwgCryrVidvor0+ElUxGosbZPQG4= +github.com/moby/buildkit v0.12.5 h1:RNHH1l3HDhYyZafr5EgstEu8aGNCwyfvMtrQDtjH9T0= +github.com/moby/buildkit v0.12.5/go.mod h1:YGwjA2loqyiYfZeEo8FtI7z4x5XponAaIWsWcSjWwso= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= -github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78= -github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= +github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g= +github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI= @@ -131,9 +131,9 @@ github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= -github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= -github.com/opencontainers/runc v1.1.7 h1:y2EZDS8sNng4Ksf0GUYNhKbTShZJPJg1FiXJNH/uoCk= +github.com/opencontainers/image-spec v1.1.0-rc6 h1:XDqvyKsJEbRtATzkgItUqBA7QHk58yxX1Ov9HERHNqU= +github.com/opencontainers/image-spec v1.1.0-rc6/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= +github.com/opencontainers/runc v1.1.11 h1:9LjxyVlE0BPMRP2wuQDRlHV4941Jp9rc3F0+YKimopA= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU= @@ -170,10 +170,10 @@ github.com/thediveo/go-plugger/v3 v3.1.0 h1:aqtzFkP7gBU/MlL/TyMOTY0MUYixebZn8JVh github.com/thediveo/go-plugger/v3 v3.1.0/go.mod h1:bED6ehF6GQUW9NDDgJG6QS/GL1J8L8hT3RUI7GTtAWo= github.com/thediveo/ioctl v0.9.3 h1:DCxyUUY15z/Zezz+wf2nlbVf3yFh0nvfM7i7KnfgG8s= github.com/thediveo/ioctl v0.9.3/go.mod h1:Ro3WW0UuPDh1QByEwNb/alva3ODM+GbRlb80u/LZU9o= -github.com/thediveo/lxkns v0.31.0 h1:vjUaMfYG+Xafep6L/QUDfU+xK+jpzrZQyG0OKQAnfhg= -github.com/thediveo/lxkns v0.31.0/go.mod h1:agBgLaQTIIRC0+GzEzqdRxK4sihsZkvpp4Nsp10+Rl4= -github.com/thediveo/morbyd v0.9.1 h1:/YpyJsXzHJbYJ9qMYerNVUr0y/EEEBg5YpiEkqzdazU= -github.com/thediveo/morbyd v0.9.1/go.mod h1:DTGutlA9RC9yG2y1Gk0ZtJNOJ72Xp8BjJKmcf0mUxCw= +github.com/thediveo/lxkns v0.32.4 h1:WX1AOjZBxqrDu62e1bycZzWc8s12Eqyea8YpC1kA5dQ= +github.com/thediveo/lxkns v0.32.4/go.mod h1:PeLloyoRrelm4epdJ+6UCFwHrT7ha9w5QhLIpGA9QT8= +github.com/thediveo/morbyd v0.9.2 h1:M9pW/sya8XPr4C5Zy8H1XlAAiwQ2Vm4agCi3FbgkSeE= +github.com/thediveo/morbyd v0.9.2/go.mod h1:QLFDFTefRNbwcf1TlNW1gBsD+b4EaTHJNHw55EysYLA= github.com/thediveo/namspill v0.1.6 h1:eD8puqhwIkBS78vrzJtY46eurHX0o6JIAqzgkRmMLl0= github.com/thediveo/notwork v1.3.1 h1:KG1Jh7pWU+QTl+7yMzs2Zugl8JZsP0x4OwNFt0rItL0= github.com/thediveo/once v0.9.1 h1:gk/8dYOto5cVEBH0LK1vYyOFH9OvugcZ12e+UnJpmTo= @@ -182,8 +182,8 @@ github.com/thediveo/procfsroot v1.0.1/go.mod h1:COuiAyTYS1iy2NP2Uti9YzTxxWqQlNMD github.com/thediveo/success v1.0.2 h1:w+r3RbSjLmd7oiNnlCblfGqItcsaShcuAorRVh/+0xk= github.com/thediveo/success v1.0.2/go.mod h1:hdPJB77k70w764lh8uLUZgNhgeTl3DYeZ4d4bwMO2CU= github.com/thediveo/testbasher v1.0.8 h1:5V02Jx+XxnXWAS3V0a5buDH2XKP7bacy34nEL8AW2qk= -github.com/thediveo/whalewatcher v0.11.0 h1:TwCVo6YSHnyu3GSFNbY/VnU8fdMba8XIBloOttcD7+s= -github.com/thediveo/whalewatcher v0.11.0/go.mod h1:GfjSmFHT+MccFjFR48+KVCJZcEe2BG1ZQ7essnREWTM= +github.com/thediveo/whalewatcher v0.11.1 h1:qR1IuMeK5wk2Hsn0g/VjlSD4ZuE9WHr/6uuaLKDiYFc= +github.com/thediveo/whalewatcher v0.11.1/go.mod h1:Hxp9tQaikta5iOWS3mnYRzU2JhmK1vqEptjZmnkS43k= github.com/vishvananda/netlink v1.2.1-beta.2.0.20230206183746-70ca0345eede h1:S+/0qI1RT0iW4moxdCoopW5JvXWU9pbJXM96IElhDF0= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f h1:p4VB7kIXpOQvVn1ZaTIVp+3vuYAXFe3OJEvjbUYJLaA= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= @@ -276,19 +276,19 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= +google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 h1:/IWabOtPziuXTEtI1KYCpM6Ss7vaAkeMxk+uXV/xvZs= +google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= +google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= -google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -301,8 +301,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= @@ -312,5 +312,5 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/cri-api v0.28.5 h1:5TgjH4tbCqRJqtfkU/EInHNDCHfqI7b0oTqApBn23Lk= -k8s.io/cri-api v0.28.5/go.mod h1:QaLIWi4Ejw0uHZlGRUIDmc2IlNlwc9Wp4gb6tEjeQCs= +k8s.io/cri-api v0.28.6 h1:TN2vRaf8656ag46dG5J30xxkr9mu1/14NZWkvhJTCEk= +k8s.io/cri-api v0.28.6/go.mod h1:zWVXihHsxPjRh4EBQHirnniYdqE4SmnLzv2nn56iL+Q= From e602508dd8e86a5e5fbcd924418a233154607253 Mon Sep 17 00:00:00 2001 From: thediveo Date: Fri, 2 Feb 2024 20:42:48 +0100 Subject: [PATCH 6/7] chore: coverage Signed-off-by: thediveo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20a858f..41e4eab 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ![goroutines](https://img.shields.io/badge/go%20routines-not%20leaking-success) ![file descriptors](https://img.shields.io/badge/file%20descriptors-not%20leaking-success) [![Go Report Card](https://goreportcard.com/badge/github.com/siemens/turtlefinder)](https://goreportcard.com/report/github.com/siemens/turtlefinder) -![Coverage](https://img.shields.io/badge/Coverage-87.8%25-brightgreen) +![Coverage](https://img.shields.io/badge/Coverage-87.4%25-brightgreen) > 🐢🐘 ["Turtles all the way down" > (Wikipedia)](https://en.wikipedia.org/wiki/Turtles_all_the_way_down) From 371c2d30b65ef198675c37cc654b58b41ca021e2 Mon Sep 17 00:00:00 2001 From: thediveo Date: Fri, 2 Feb 2024 20:55:44 +0100 Subject: [PATCH 7/7] doc: bump up year Signed-off-by: thediveo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41e4eab..d4f89a7 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,6 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md). ## License and Copyright -(c) Siemens AG 2023 +(c) Siemens AG 2023‒24 [SPDX-License-Identifier: MIT](LICENSE)