Skip to content

Commit 3e546aa

Browse files
author
Kazuyoshi Kato
authored
Merge pull request #251 from kzys/add-v2
Rename the package to github.com/containerd/cgroups/v2
2 parents f4ad3d9 + 5650e1c commit 3e546aa

47 files changed

Lines changed: 301 additions & 305 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ jobs:
110110

111111
- name: Run cgroup tests
112112
run: |
113-
sudo -E PATH=$PATH GOPATH=$GOPATH \
114-
$(command -v go) test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
113+
$(command -v go) test -exec sudo -v -race -coverprofile=coverage.txt -covermode=atomic ./...
114+
working-directory: src/github.com/containerd/cgroups
115+
116+
- name: Build cgctl
117+
run: make all
115118
working-directory: src/github.com/containerd/cgroups
116119

117120
proto:
@@ -144,8 +147,8 @@ jobs:
144147
- name: Install proto-related tools for Go
145148
run: |
146149
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
147-
go install github.com/containerd/protobuild@v0.2.0
148-
go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.2.0
150+
go install github.com/containerd/protobuild@v0.3.0
151+
go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.3.0
149152
150153
- name: Compare auto-generated Go files
151154
run: |

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ cgutil:
2323
proto:
2424
protobuild --quiet ${PACKAGES}
2525
# Keep them Go-idiomatic and backward-compatible with the gogo/protobuf era.
26-
go-fix-acronym -w -a '(Cpu|Tcp|Rss)' $(shell find stats/v1/ v2/stats/ -name '*.pb.go')
26+
go-fix-acronym -w -a '(Cpu|Tcp|Rss)' $(shell find stats/v1/ cgroup2/stats/ -name '*.pb.go')

Protobuild.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ ignore_files = [
2121
"google/protobuf/descriptor.proto",
2222
]
2323
[[descriptors]]
24-
prefix = "github.com/containerd/cgroups/v2/stats"
25-
target = "v2/stats/metrics.pb.txt"
24+
prefix = "github.com/containerd/cgroups/cgroup2/stats"
25+
target = "cgroup2/stats/metrics.pb.txt"
2626
ignore_files = [
2727
"google/protobuf/descriptor.proto",
2828
]
29+
30+
[parameters.go]
31+
paths = "source_relative"

blkio.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"strconv"
2626
"strings"
2727

28-
v1 "github.com/containerd/cgroups/stats/v1"
28+
v1 "github.com/containerd/cgroups/v2/stats/v1"
2929
specs "github.com/opencontainers/runtime-spec/specs-go"
3030
)
3131

blkio_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"strings"
2222
"testing"
2323

24-
v1 "github.com/containerd/cgroups/stats/v1"
24+
v1 "github.com/containerd/cgroups/v2/stats/v1"
2525
)
2626

2727
const data = `major minor #blocks name
@@ -45,7 +45,7 @@ func TestGetDevices(t *testing.T) {
4545
t.Fatal(err)
4646
}
4747
for dev, expected := range map[deviceKey]string{
48-
deviceKey{7, 0}: "/dev/loop0",
48+
deviceKey{7, 0}: "/dev/loop0",
4949
deviceKey{259, 0}: "/dev/nvme0n1",
5050
deviceKey{259, 1}: "/dev/nvme0n1p1",
5151
} {

cgroup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"syscall"
2929
"time"
3030

31-
v1 "github.com/containerd/cgroups/stats/v1"
31+
v1 "github.com/containerd/cgroups/v2/stats/v1"
3232

3333
"github.com/opencontainers/runtime-spec/specs-go"
3434
)

v2/cpu.go renamed to cgroup2/cpu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package v2
17+
package cgroup2
1818

1919
import (
2020
"math"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package v2
17+
package cgroup2
1818

1919
import (
2020
"fmt"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// This particular Go implementation based on runc version
2525
// https://github.com/opencontainers/runc/blob/master/libcontainer/cgroups/ebpf/devicefilter/devicefilter.go
2626

27-
package v2
27+
package cgroup2
2828

2929
import (
3030
"errors"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package v2
17+
package cgroup2
1818

1919
import (
2020
"strings"

0 commit comments

Comments
 (0)