diff --git a/Makefile b/Makefile index 3d1b62245..402bff291 100644 --- a/Makefile +++ b/Makefile @@ -105,9 +105,9 @@ GO_LDFLAGS+=' SHIM_GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) -extldflags "-static" $(EXTRA_LDFLAGS)' # Project packages. -PACKAGES=$(shell $(GO) list ${GO_TAGS} ./... | grep -v /vendor/ | grep -v /integration) -API_PACKAGES=$(shell (cd api && $(GO) list ${GO_TAGS} ./... | grep -v /vendor/ | grep -v /integration)) -NON_API_PACKAGES=$(shell $(GO) list ${GO_TAGS} ./... | grep -v /vendor/ | grep -v /integration | grep -v "containerd/api") +PACKAGES=$(shell $(GO) list ${GO_TAGS} ./... | grep -v /vendor/ | grep -v /integration | grep -v /third_party) +API_PACKAGES=$(shell (cd api && $(GO) list ${GO_TAGS} ./... | grep -v /vendor/ | grep -v /integration | grep -v /third_party)) +NON_API_PACKAGES=$(shell $(GO) list ${GO_TAGS} ./... | grep -v /vendor/ | grep -v /integration | grep -v /third_party | grep -v "containerd/api") TEST_REQUIRES_ROOT_PACKAGES=$(filter \ ${PACKAGES}, \ $(shell \ @@ -172,7 +172,7 @@ generate: protos protos: bin/protoc-gen-go-fieldpath @echo "$(WHALE) $@" - @find . -path ./vendor -prune -false -o -name '*.pb.go' | xargs rm + @find . -path ./vendor -prune -false -o -path ./third_party -prune -false -o -name '*.pb.go' | xargs rm $(eval TMPDIR := $(shell mktemp -d)) @mv ${ROOTDIR}/vendor ${TMPDIR} @(cd ${ROOTDIR}/api && PATH="${ROOTDIR}/bin:${PATH}" protobuild --quiet ${API_PACKAGES}) @@ -195,7 +195,7 @@ check-api-descriptors: protos ## check that protobuf changes aren't present. proto-fmt: ## check format of proto files @echo "$(WHALE) $@" - @test -z "$$(find . -path ./vendor -prune -o -path ./protobuf/google/rpc -prune -o -name '*.proto' -type f -exec grep -Hn -e "^ " {} \; | tee /dev/stderr)" || \ + @test -z "$$(find . -path ./vendor -prune -o -path ./protobuf/google/rpc -prune -o -path ./third_party -prune -false -o -name '*.proto' -type f -exec grep -Hn -e "^ " {} \; | tee /dev/stderr)" || \ (echo "$(ONI) please indent proto files with tabs only" && false) build: ## build the go packages diff --git a/go.mod b/go.mod index ff15dba46..1cb98f839 100644 --- a/go.mod +++ b/go.mod @@ -30,6 +30,7 @@ require ( github.com/docker/go-units v0.4.0 github.com/emicklei/go-restful/v3 v3.8.0 github.com/fsnotify/fsnotify v1.5.1 + github.com/gogo/protobuf v1.3.2 github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.3.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 @@ -93,7 +94,6 @@ require ( github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus/v5 v5.0.6 // 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.2 // indirect github.com/google/gofuzz v1.2.0 // indirect diff --git a/pkg/cri/sbserver/instrumented_service.go b/pkg/cri/sbserver/instrumented_service.go index e19457cdd..afe5b4d14 100644 --- a/pkg/cri/sbserver/instrumented_service.go +++ b/pkg/cri/sbserver/instrumented_service.go @@ -22,9 +22,9 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" + runtime_alpha "github.com/containerd/containerd/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "github.com/containerd/containerd/tracing" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" - runtime_alpha "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" ctrdutil "github.com/containerd/containerd/pkg/cri/util" ) diff --git a/pkg/cri/sbserver/service.go b/pkg/cri/sbserver/service.go index 8d88bfa14..289b6a2b1 100644 --- a/pkg/cri/sbserver/service.go +++ b/pkg/cri/sbserver/service.go @@ -35,11 +35,11 @@ import ( "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/sandbox" "github.com/containerd/containerd/sandbox/proxy" + runtime_alpha "github.com/containerd/containerd/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "github.com/containerd/go-cni" "github.com/sirupsen/logrus" "google.golang.org/grpc" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" - runtime_alpha "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "github.com/containerd/containerd/pkg/cri/store/label" diff --git a/pkg/cri/sbserver/version.go b/pkg/cri/sbserver/version.go index 20a754e72..59fb61bda 100644 --- a/pkg/cri/sbserver/version.go +++ b/pkg/cri/sbserver/version.go @@ -19,9 +19,9 @@ package sbserver import ( "context" + runtime_alpha "github.com/containerd/containerd/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "github.com/containerd/containerd/version" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" - runtime_alpha "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "github.com/containerd/containerd/pkg/cri/constants" ) diff --git a/pkg/cri/server/instrumented_service.go b/pkg/cri/server/instrumented_service.go index 6976e0c4d..84df34d40 100644 --- a/pkg/cri/server/instrumented_service.go +++ b/pkg/cri/server/instrumented_service.go @@ -22,9 +22,9 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" + runtime_alpha "github.com/containerd/containerd/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "github.com/containerd/containerd/tracing" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" - runtime_alpha "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" ctrdutil "github.com/containerd/containerd/pkg/cri/util" ) diff --git a/pkg/cri/server/service.go b/pkg/cri/server/service.go index 04ec294d3..0919b9d96 100644 --- a/pkg/cri/server/service.go +++ b/pkg/cri/server/service.go @@ -31,11 +31,11 @@ import ( "github.com/containerd/containerd/pkg/cri/streaming" "github.com/containerd/containerd/pkg/kmutex" "github.com/containerd/containerd/plugin" + runtime_alpha "github.com/containerd/containerd/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2" cni "github.com/containerd/go-cni" "github.com/sirupsen/logrus" "google.golang.org/grpc" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" - runtime_alpha "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "github.com/containerd/containerd/pkg/cri/store/label" diff --git a/pkg/cri/server/version.go b/pkg/cri/server/version.go index 5e3091a35..fce877aa7 100644 --- a/pkg/cri/server/version.go +++ b/pkg/cri/server/version.go @@ -19,9 +19,9 @@ package server import ( "context" + runtime_alpha "github.com/containerd/containerd/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "github.com/containerd/containerd/version" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" - runtime_alpha "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" "github.com/containerd/containerd/pkg/cri/constants" ) diff --git a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go b/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go similarity index 100% rename from vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go rename to third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go diff --git a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto b/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto similarity index 99% rename from vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto rename to third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto index 6f6734e60..607902e21 100644 --- a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto +++ b/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto @@ -756,7 +756,7 @@ message SELinuxOption { // Capability contains the container capabilities to add or drop // Dropping a capability will drop it from all sets. -// If a capability is added to only the add_capabilities list then it gets added to permitted, +// If a capability is added to only the add_capabilities list then it gets added to permitted, // inheritable, effective and bounding sets, i.e. all sets except the ambient set. // If a capability is added to only the add_ambient_capabilities list then it gets added to all sets, i.e permitted // inheritable, effective, bounding and ambient sets. diff --git a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/constants.go b/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/constants.go similarity index 76% rename from vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/constants.go rename to third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/constants.go index 0e141b7d7..0a93cac30 100644 --- a/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/constants.go +++ b/third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/constants.go @@ -1,3 +1,19 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + /* Copyright 2016 The Kubernetes Authors. diff --git a/vendor/modules.txt b/vendor/modules.txt index dfe58ad3b..e57c5a3cd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -774,7 +774,6 @@ k8s.io/component-base/version # k8s.io/cri-api v0.25.4 ## explicit; go 1.19 k8s.io/cri-api/pkg/apis/runtime/v1 -k8s.io/cri-api/pkg/apis/runtime/v1alpha2 # k8s.io/klog/v2 v2.80.1 ## explicit; go 1.13 k8s.io/klog/v2