Skip to content

Commit 934815e

Browse files
committed
make plugins/ulimit-adjuster a separate module
Also switch it to use the new log module, instead of depending on containerd Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent e2d9a1b commit 934815e

4 files changed

Lines changed: 237 additions & 2 deletions

File tree

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ PLUGINS := \
4242
$(BIN_PATH)/device-injector \
4343
$(BIN_PATH)/hook-injector \
4444
$(BIN_PATH)/differ \
45+
$(BIN_PATH)/ulimit-adjuster \
4546
$(BIN_PATH)/v010-adapter \
4647
$(BIN_PATH)/template
4748

@@ -105,6 +106,10 @@ $(BIN_PATH)/differ: $(wildcard plugins/differ/*.go)
105106
$(Q)echo "Building $@..."; \
106107
cd $(dir $<) && $(GO_BUILD) -o $@ .
107108

109+
$(BIN_PATH)/ulimit-adjuster: $(wildcard plugins/ulimit-adjuster/*.go)
110+
$(Q)echo "Building $@..."; \
111+
cd $(dir $<) && $(GO_BUILD) -o $@ .
112+
108113
$(BIN_PATH)/v010-adapter: $(wildcard plugins/v010-adapter/*.go)
109114
$(Q)echo "Building $@..."; \
110115
cd $(dir $<) && $(GO_BUILD) -o $@ .
@@ -136,7 +141,7 @@ ginkgo-tests:
136141
$(GO_CMD) tool cover -html=$(COVERAGE_PATH)/coverprofile -o $(COVERAGE_PATH)/coverage.html
137142

138143
test-ulimits:
139-
$(Q)$(GO_TEST) -v ./plugins/ulimit-adjuster
144+
$(Q)cd ./plugins/ulimit-adjuster && $(GO_TEST) -v
140145

141146
codecov: SHELL := $(shell which bash)
142147
codecov:

plugins/ulimit-adjuster/adjuster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"os"
2424
"strings"
2525

26-
"github.com/containerd/containerd/log"
26+
"github.com/containerd/log"
2727
"github.com/sirupsen/logrus"
2828
"sigs.k8s.io/yaml"
2929

plugins/ulimit-adjuster/go.mod

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module github.com/containerd/nri/plugins/ulimit-adjuster
2+
3+
go 1.19
4+
5+
replace github.com/containerd/nri => ../..
6+
7+
require (
8+
github.com/containerd/log v0.1.0
9+
github.com/containerd/nri v0.0.0-00010101000000-000000000000
10+
github.com/sirupsen/logrus v1.9.3
11+
github.com/stretchr/testify v1.8.2
12+
sigs.k8s.io/yaml v1.3.0
13+
)
14+
15+
require (
16+
github.com/containerd/ttrpc v1.1.1-0.20220420014843-944ef4a40df3 // indirect
17+
github.com/davecgh/go-spew v1.1.1 // indirect
18+
github.com/gogo/protobuf v1.3.2 // indirect
19+
github.com/golang/protobuf v1.5.2 // indirect
20+
github.com/opencontainers/runtime-spec v1.0.3-0.20220825212826-86290f6a00fb // indirect
21+
github.com/pmezard/go-difflib v1.0.0 // indirect
22+
golang.org/x/net v0.1.0 // indirect
23+
golang.org/x/sys v0.7.0 // indirect
24+
golang.org/x/text v0.4.0 // indirect
25+
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect
26+
google.golang.org/grpc v1.47.0 // indirect
27+
google.golang.org/protobuf v1.28.1 // indirect
28+
gopkg.in/yaml.v2 v2.4.0 // indirect
29+
gopkg.in/yaml.v3 v3.0.1 // indirect
30+
k8s.io/cri-api v0.25.3 // indirect
31+
)

0 commit comments

Comments
 (0)