Skip to content
Permalink
Browse files

merge branch 'pr-2073'

Odin Ugedal (7):
  Run verify-dependencies only on go1.x
  Don't add git utils to go.mod in CI
  Remove refrences to vndr
  Make CI script to verify that vendor is in sync
  Fix file permissions for mounts.bats
  Update spec test to use go.mod
  Add support for GO Modules

LGTMs: @hqhq @AkihiroSuda @cyphar
Closes #2073
  • Loading branch information
cyphar committed Mar 16, 2020
2 parents 9167393 + 777f97d commit a15d2c3ca006968d795f7c9636bdfab7a3ac7cbb
Showing with 3,201 additions and 2,722 deletions.
  1. +6 −2 .travis.yml
  2. +12 −1 Makefile
  3. +10 −3 README.md
  4. +26 −0 go.mod
  5. +51 −0 go.sum
  6. 0 tests/integration/mounts.bats
  7. +8 −2 tests/integration/spec.bats
  8. +0 −31 vendor.conf
  9. +0 −58 vendor/github.com/checkpoint-restore/go-criu/README.md
  10. +0 −133 vendor/github.com/checkpoint-restore/go-criu/test/main.go
  11. +0 −192 vendor/github.com/checkpoint-restore/go-criu/test/phaul-main.go
  12. +0 −57 vendor/github.com/checkpoint-restore/go-criu/test/piggie.c
  13. +12 −0 vendor/github.com/cilium/ebpf/.gitignore
  14. +46 −0 vendor/github.com/cilium/ebpf/CODE_OF_CONDUCT.md
  15. +4 −0 vendor/github.com/cilium/ebpf/go.sum
  16. +67 −0 vendor/github.com/cilium/ebpf/run-tests.sh
  17. +27 −0 vendor/github.com/containerd/console/.travis.yml
  18. +0 −71 vendor/github.com/coreos/go-systemd/README.md
  19. +19 −0 vendor/github.com/cyphar/filepath-securejoin/.travis.yml
  20. +1 −0 vendor/github.com/cyphar/filepath-securejoin/VERSION
  21. +67 −0 vendor/github.com/docker/go-units/CONTRIBUTING.md
  22. +46 −0 vendor/github.com/docker/go-units/MAINTAINERS
  23. +11 −0 vendor/github.com/docker/go-units/circle.yml
  24. +46 −0 vendor/github.com/godbus/dbus/.travis.yml
  25. +50 −0 vendor/github.com/godbus/dbus/CONTRIBUTING.md
  26. +3 −0 vendor/github.com/godbus/dbus/MAINTAINERS
  27. +3 −0 vendor/github.com/golang/protobuf/AUTHORS
  28. +3 −0 vendor/github.com/golang/protobuf/CONTRIBUTORS
  29. +0 −244 vendor/github.com/golang/protobuf/README.md
  30. +43 −0 vendor/github.com/golang/protobuf/proto/Makefile
  31. +9 −0 vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE
  32. +40 −0 vendor/github.com/konsorten/go-windows-terminal-sequences/README.md
  33. +1 −0 vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod
  34. +36 −0 vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go
  35. +1 −0 vendor/github.com/mrunalp/fileutils/.gitignore
  36. +1 −0 vendor/github.com/mrunalp/fileutils/MAINTAINERS
  37. +0 −153 vendor/github.com/opencontainers/runtime-spec/README.md
  38. +0 −18 vendor/github.com/opencontainers/selinux/README.md
  39. +0 −8 vendor/github.com/opencontainers/selinux/go.mod
  40. +24 −0 vendor/github.com/pkg/errors/.gitignore
  41. +15 −0 vendor/github.com/pkg/errors/.travis.yml
  42. +32 −0 vendor/github.com/pkg/errors/appveyor.yml
  43. +4 −0 vendor/github.com/seccomp/libseccomp-golang/.gitignore
  44. +17 −0 vendor/github.com/seccomp/libseccomp-golang/CHANGELOG
  45. +26 −0 vendor/github.com/seccomp/libseccomp-golang/Makefile
  46. +112 −0 vendor/github.com/seccomp/libseccomp-golang/SUBMITTING_PATCHES
  47. +2 −0 vendor/github.com/sirupsen/logrus/.gitignore
  48. +21 −0 vendor/github.com/sirupsen/logrus/.travis.yml
  49. +198 −0 vendor/github.com/sirupsen/logrus/CHANGELOG.md
  50. +14 −0 vendor/github.com/sirupsen/logrus/appveyor.yml
  51. +13 −0 vendor/github.com/sirupsen/logrus/go.sum
  52. +2 −0 vendor/github.com/urfave/cli/.flake8
  53. +2 −0 vendor/github.com/urfave/cli/.gitignore
  54. +27 −0 vendor/github.com/urfave/cli/.travis.yml
  55. +435 −0 vendor/github.com/urfave/cli/CHANGELOG.md
  56. +26 −0 vendor/github.com/urfave/cli/appveyor.yml
  57. +93 −0 vendor/github.com/urfave/cli/flag-types.json
  58. +255 −0 vendor/github.com/urfave/cli/generate-flag-types
  59. +122 −0 vendor/github.com/urfave/cli/runtests
  60. +3 −0 vendor/github.com/vishvananda/netlink/.travis.yml
  61. +29 −0 vendor/github.com/vishvananda/netlink/Makefile
  62. +3 −0 vendor/golang.org/x/sys/AUTHORS
  63. +3 −0 vendor/golang.org/x/sys/CONTRIBUTORS
  64. +0 −18 vendor/golang.org/x/sys/README.md
  65. +0 −17 vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s
  66. +0 −60 vendor/golang.org/x/sys/cpu/byteorder.go
  67. +0 −162 vendor/golang.org/x/sys/cpu/cpu.go
  68. +0 −34 vendor/golang.org/x/sys/cpu/cpu_aix_ppc64.go
  69. +0 −40 vendor/golang.org/x/sys/cpu/cpu_arm.go
  70. +0 −21 vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go
  71. +0 −16 vendor/golang.org/x/sys/cpu/cpu_gc_x86.go
  72. +0 −43 vendor/golang.org/x/sys/cpu/cpu_gccgo.c
  73. +0 −26 vendor/golang.org/x/sys/cpu/cpu_gccgo.go
  74. +0 −22 vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go
  75. +0 −59 vendor/golang.org/x/sys/cpu/cpu_linux.go
  76. +0 −39 vendor/golang.org/x/sys/cpu/cpu_linux_arm.go
  77. +0 −67 vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
  78. +0 −9 vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go
  79. +0 −33 vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go
  80. +0 −161 vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go
  81. +0 −9 vendor/golang.org/x/sys/cpu/cpu_mips64x.go
  82. +0 −9 vendor/golang.org/x/sys/cpu/cpu_mipsx.go
  83. +0 −9 vendor/golang.org/x/sys/cpu/cpu_other_arm64.go
  84. +0 −9 vendor/golang.org/x/sys/cpu/cpu_riscv64.go
  85. +0 −57 vendor/golang.org/x/sys/cpu/cpu_s390x.s
  86. +0 −13 vendor/golang.org/x/sys/cpu/cpu_wasm.go
  87. +0 −59 vendor/golang.org/x/sys/cpu/cpu_x86.go
  88. +0 −27 vendor/golang.org/x/sys/cpu/cpu_x86.s
  89. +0 −36 vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go
  90. +0 −3 vendor/golang.org/x/sys/go.mod
  91. +2 −0 vendor/golang.org/x/sys/unix/.gitignore
  92. +229 −0 vendor/golang.org/x/sys/unix/mkall.sh
  93. +686 −0 vendor/golang.org/x/sys/unix/mkerrors.sh
  94. +63 −0 vendor/golang.org/x/sys/windows/mkerrors.bash
  95. +27 −0 vendor/golang.org/x/sys/windows/mkknownfolderids.bash
  96. +0 −48 vendor/golang.org/x/sys/windows/svc/event.go
  97. +0 −24 vendor/golang.org/x/sys/windows/svc/go12.c
  98. +0 −11 vendor/golang.org/x/sys/windows/svc/go12.go
  99. +0 −31 vendor/golang.org/x/sys/windows/svc/go13.go
  100. +0 −62 vendor/golang.org/x/sys/windows/svc/security.go
  101. +0 −364 vendor/golang.org/x/sys/windows/svc/service.go
  102. +0 −69 vendor/golang.org/x/sys/windows/svc/sys_386.s
  103. +0 −44 vendor/golang.org/x/sys/windows/svc/sys_amd64.s
  104. +0 −38 vendor/golang.org/x/sys/windows/svc/sys_arm.s
  105. +67 −0 vendor/modules.txt
@@ -8,6 +8,10 @@ go:

matrix:
include:
- go: 1.x
name: "verify-dependencies"
script:
- make verify-dependencies
- go: 1.12.x
name: "cgroup-systemd"
env:
@@ -48,8 +52,8 @@ env:
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y libseccomp-dev
- go get -u golang.org/x/lint/golint
- go get -u github.com/vbatts/git-validation
- GO111MODULE=off go get -u golang.org/x/lint/golint
- GO111MODULE=off go get -u github.com/vbatts/git-validation
- env | grep TRAVIS_

script:
@@ -1,7 +1,7 @@
.PHONY: all shell dbuild man release \
localtest localunittest localintegration \
test unittest integration \
cross localcross
cross localcross vendor verify-dependencies

CONTAINER_ENGINE := docker
GO := go
@@ -119,6 +119,17 @@ validate:

ci: validate test release

vendor:
export GO111MODULE=on \
$(GO) mod tidy && \
$(GO) mod vendor && \
$(GO) mod verify

verify-dependencies: vendor
@test -z "$$(git status --porcelain -- go.mod go.sum vendor/)" \
|| (echo -e "git status:\n $$(git status -- go.mod go.sum vendor/)\nerror: vendor/, go.mod and/or go.sum not up to date. Run \"make vendor\" to update"; exit 1) \
&& echo "all vendor files are up to date."

cross: runcimage
$(CONTAINER_ENGINE) run ${CONTAINER_ENGINE_RUN_FLAGS} -e BUILDTAGS="$(BUILDTAGS)" --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localcross

@@ -113,9 +113,16 @@ You can run a test using your container engine's flags by setting `CONTAINER_ENG

### Dependencies Management

`runc` uses [vndr](https://github.com/LK4D4/vndr) for dependencies management.
Please refer to [vndr](https://github.com/LK4D4/vndr) for how to add or update
new dependencies.
`runc` uses [Go Modules](https://github.com/golang/go/wiki/Modules) for dependencies management.
Please refer to [Go Modules](https://github.com/golang/go/wiki/Modules) for how to add or update
new dependencies. When updating dependencies, be sure that you are running Go `1.14` or newer.

```
# Update vendored dependencies
make vendor
# Verify all dependencies
make verify-dependencies
```

## Using runc

26 go.mod
@@ -0,0 +1,26 @@
module github.com/opencontainers/runc

go 1.14

require (
github.com/checkpoint-restore/go-criu v0.0.0-20181120144056-17b0214f6c48
github.com/cilium/ebpf v0.0.0-20191025125908-95b36a581eed
github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e
github.com/cyphar/filepath-securejoin v0.2.2
github.com/docker/go-units v0.3.3
github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f
github.com/golang/protobuf v1.0.0
github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618
github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559
github.com/opencontainers/selinux v1.3.3
github.com/pkg/errors v0.8.1
github.com/seccomp/libseccomp-golang v0.9.1
github.com/sirupsen/logrus v1.4.1
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2
github.com/urfave/cli v1.20.0
github.com/vishvananda/netlink v0.0.0-20150820014904-1e2e08e8a2dc
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
golang.org/x/sys v0.0.0-20191115151921-52ab43148777
)
51 go.sum
@@ -0,0 +1,51 @@
github.com/checkpoint-restore/go-criu v0.0.0-20181120144056-17b0214f6c48 h1:AQMF0Xixllgf29MKlx/TGEhRk7bEDX5kxz8Ui8lOvEs=
github.com/checkpoint-restore/go-criu v0.0.0-20181120144056-17b0214f6c48/go.mod h1:TrMrLQfeENAPYPRsJuq3jsqdlRh3lvi6trTZJG8+tho=
github.com/cilium/ebpf v0.0.0-20191025125908-95b36a581eed h1:/UgmF+cZTm9kp4uJ122y/9cVhczNJCgAgAeH2FfzPeg=
github.com/cilium/ebpf v0.0.0-20191025125908-95b36a581eed/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg=
github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50 h1:WMpHmC6AxwWb9hMqhudkqG7A/p14KiMnl6d3r1iUMjU=
github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/cyphar/filepath-securejoin v0.2.2 h1:jCwT2GTP+PY5nBz3c/YL5PAIbusElVrPujOBSCj8xRg=
github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4=
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/go-units v0.3.3 h1:Xk8S3Xj5sLGlG5g67hJmYMmUgXv5N4PhkjJHHqrwnTk=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f h1:zlOR3rOlPAVvtfuxGKoghCmop5B0TRyu/ZieziZuGiM=
github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw=
github.com/golang/protobuf v1.0.0 h1:lsek0oXi8iFE9L+EXARyHIjU5rlWIhhTkjDz3vHhWWQ=
github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618 h1:7InQ7/zrOh6SlFjaXFubv0xX0HsuC9qJsdqm7bNQpYM=
github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618/go.mod h1:x8F1gnqOkIEiO4rqoeEEEqQbo7HjGMTvyoq3gej4iT0=
github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559 h1:Cef96rKLuXxeGzERI/0ve9yAzIeTpx0qz9JKFDZALYw=
github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/selinux v1.3.3 h1:RX0wAeqtvVSYQcr017X3pFXPkLEtB6V4NjRD7gVQgg4=
github.com/opencontainers/selinux v1.3.3/go.mod h1:yTcKuYAh6R95iDpefGLQaPaRwJFwyzAJufJyiTt7s0g=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/seccomp/libseccomp-golang v0.9.1 h1:NJjM5DNFOs0s3kYE1WUOr6G8V97sdt46rlXTMfXGWBo=
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 h1:b6uOv7YOFK0TYG7HtkIgExQo+2RdLuwRft63jn2HWj8=
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/vishvananda/netlink v0.0.0-20150820014904-1e2e08e8a2dc h1:0HAHLwEY4k1VqaO1SzBi4XxT0KA06Cv+QW2LXknBk9g=
github.com/vishvananda/netlink v0.0.0-20150820014904-1e2e08e8a2dc/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df h1:OviZH7qLw/7ZovXvuNyL3XQl8UFofeikI1NW1Gypu7k=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777 h1:wejkGHRTr38uaKRqECZlsCsJ1/TGxIyFbH32x5zUdu4=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
0 tests/integration/mounts.bats 100755 → 100644
No changes.
@@ -72,8 +72,14 @@ function teardown() {
run git clone https://github.com/opencontainers/runtime-spec.git src/runtime-spec
[ "$status" -eq 0 ]

SPEC_COMMIT=$(grep '^github.com/opencontainers/runtime-spec' ${TESTDIR}/../../vendor.conf | tr -s ' ' | cut -d ' ' -f 2)
run git -C src/runtime-spec reset --hard "${SPEC_COMMIT}"
SPEC_VERSION=$(grep 'github.com/opencontainers/runtime-spec' ${TESTDIR}/../../go.mod | cut -d ' ' -f 2)

# Will look like this when not pinned to spesific tag: "v0.0.0-20190207185410-29686dbc5559", otherwise "v1.0.0"
SPEC_COMMIT=$(cut -d "-" -f 3 <<< $SPEC_VERSION)

SPEC_REF=$([[ -z "$SPEC_COMMIT" ]] && echo $SPEC_VERSION || echo $SPEC_COMMIT)

run git -C src/runtime-spec reset --hard "${SPEC_REF}"

[ "$status" -eq 0 ]
[ -e src/runtime-spec/schema/config-schema.json ]

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit a15d2c3

Please sign in to comment.
You can’t perform that action at this time.