Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/onsi/ginkgo/v2 v2.19.1
github.com/onsi/gomega v1.34.0
github.com/opencontainers/runtime-spec v1.3.0
github.com/opencontainers/runtime-tools v0.9.1-0.20251114084447-edf4cb3d2116
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.4
github.com/tetratelabs/wazero v1.11.0
Expand All @@ -30,7 +29,6 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/moby/sys/capability v0.4.0 // indirect
github.com/planetscale/vtprotobuf v0.4.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
Expand Down
18 changes: 0 additions & 18 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/brianvoe/gofakeit/v7 v7.12.1 h1:df1tiI4SL1dR5Ix4D/r6a3a+nXBJ/OBGU5jEKRBmmqg=
github.com/brianvoe/gofakeit/v7 v7.12.1/go.mod h1:QXuPeBw164PJCzCUZVmgpgHJ3Llj49jSLVkKPMtxtxA=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
Expand All @@ -22,10 +20,6 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg=
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/knqyf263/go-plugin v0.9.0 h1:CQs2+lOPIlkZVtcb835ZYDEoyyWJWLbSTWeCs0EwTwI=
github.com/knqyf263/go-plugin v0.9.0/go.mod h1:2z5lCO1/pez6qGo8CvCxSlBFSEat4MEp1DrnA+f7w8Q=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
Expand All @@ -35,8 +29,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/moby/sys/capability v0.4.0 h1:4D4mI6KlNtWMCM1Z/K0i7RV1FkX+DBDHKVJpCndZoHk=
github.com/moby/sys/capability v0.4.0/go.mod h1:4g9IK291rVkms3LKCDOoYlnV8xKwoDTpIrNEE35Wq0I=
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=
github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0=
Expand All @@ -45,10 +37,6 @@ github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os=
github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo=
github.com/opencontainers/runtime-spec v1.3.0 h1:YZupQUdctfhpZy3TM39nN9Ika5CBWT5diQ8ibYCRkxg=
github.com/opencontainers/runtime-spec v1.3.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/runtime-tools v0.9.1-0.20251114084447-edf4cb3d2116 h1:tAKu3NkKWZYpqBSOJKwTxT1wIGueiF7gcmcNgr5pNTY=
github.com/opencontainers/runtime-tools v0.9.1-0.20251114084447-edf4cb3d2116/go.mod h1:DKDEfzxvRkoQ6n9TGhxQgg2IM1lY4aM0eaQP4e3oElw=
github.com/opencontainers/selinux v1.9.1 h1:b4VPEF3O5JLZgdTDBmGepaaIbAo0GqoF6EBRq5f/g3Y=
github.com/opencontainers/selinux v1.9.1/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/planetscale/vtprotobuf v0.4.0 h1:NEI+g4woRaAZgeZ3sAvbtyvMBRjIv5kE7EWYQ8m4JwY=
github.com/planetscale/vtprotobuf v0.4.0/go.mod h1:wm1N3qk9G/4+VM1WhpkLbvY/d8+0PbwYYpP5P5VhTks=
Expand All @@ -68,12 +56,6 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tetratelabs/wazero v1.11.0 h1:+gKemEuKCTevU4d7ZTzlsvgd1uaToIDtlQlmNbwqYhA=
github.com/tetratelabs/wazero v1.11.0/go.mod h1:eV28rsN8Q+xwjogd7f4/Pp4xFxO7uOGbLcD/LzB1wiU=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/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=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c=
Expand Down
2 changes: 1 addition & 1 deletion pkg/adaptation/plugin_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ import (
)

// getPeerPid returns the process id at the other end of the connection.
func getPeerPid(conn net.Conn) (int, error) {
func getPeerPid(net.Conn) (int, error) {
return 0, fmt.Errorf("getPeerPid() unimplemented on %s", runtime.GOOS)
}
60 changes: 21 additions & 39 deletions pkg/runtime-tools/generate/generate_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
. "github.com/onsi/gomega"

rspec "github.com/opencontainers/runtime-spec/specs-go"
rgen "github.com/opencontainers/runtime-tools/generate"

"github.com/containerd/nri/pkg/api"
xgen "github.com/containerd/nri/pkg/runtime-tools/generate"
"github.com/containerd/nri/pkg/runtime-tools/internal/ocigen"
)

func TestGenerate(t *testing.T) {
Expand All @@ -42,8 +42,7 @@ var _ = Describe("Adjustment", func() {
adjust *api.ContainerAdjustment
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -60,8 +59,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -82,8 +80,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -104,8 +101,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -128,8 +124,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -151,8 +146,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -171,8 +165,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -191,8 +184,7 @@ var _ = Describe("Adjustment", func() {
spec.Process.OOMScoreAdj = &oomScoreAdj
expectedSpec.Process.OOMScoreAdj = &oomScoreAdj

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -215,8 +207,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -239,8 +230,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -263,8 +253,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -287,8 +276,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -311,8 +299,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -335,8 +322,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand Down Expand Up @@ -370,8 +356,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand Down Expand Up @@ -420,8 +405,7 @@ var _ = Describe("Adjustment", func() {
}
)

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -445,8 +429,8 @@ var _ = Describe("Adjustment", func() {
spec.Linux.Sysctl = map[string]string{
"delete.me": "foobar",
}
rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)

xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -470,8 +454,7 @@ var _ = Describe("Adjustment", func() {
},
}

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand All @@ -494,8 +477,7 @@ var _ = Describe("Adjustment", func() {
},
}

rg := &rgen.Generator{Config: spec}
xg := xgen.SpecGenerator(rg)
xg := xgen.SpecGenerator(ocigen.New(spec))

Expect(xg).ToNot(BeNil())
Expect(xg.Adjust(adjust)).To(Succeed())
Expand Down
2 changes: 1 addition & 1 deletion pkg/runtime-tools/generate/helpers_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

package generate

func ensurePropagation(path string, accepted ...string) error {
func ensurePropagation(string, ...string) error {
return nil
}
Loading
Loading