Skip to content

Commit 193af78

Browse files
authored
Merge pull request containerd#10151 from dmcgowan/move-proto-to-api
Add api Go module and move all protos under api
2 parents a91b05d + 171fc14 commit 193af78

File tree

404 files changed

+42779
-888
lines changed

Some content is hidden

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

404 files changed

+42779
-888
lines changed

Makefile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ SHIM_GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version
109109
# Project packages.
110110
PACKAGES=$(shell $(GO) list ${GO_TAGS} ./... | grep -v /vendor/ | grep -v /integration)
111111
API_PACKAGES=$(shell (cd api && $(GO) list ${GO_TAGS} ./... | grep -v /vendor/ | grep -v /integration))
112-
NON_API_PACKAGES=$(shell $(GO) list ${GO_TAGS} ./... | grep -v /vendor/ | grep -v /integration | grep -v "containerd/api")
113112
TEST_REQUIRES_ROOT_PACKAGES=$(filter \
114113
${PACKAGES}, \
115114
$(shell \
@@ -178,12 +177,10 @@ protos: bin/protoc-gen-go-fieldpath
178177
$(eval TMPDIR := $(shell mktemp -d))
179178
@mv ${ROOTDIR}/vendor ${TMPDIR}
180179
@(cd ${ROOTDIR}/api && PATH="${ROOTDIR}/bin:${PATH}" protobuild --quiet ${API_PACKAGES})
181-
@(PATH="${ROOTDIR}/bin:${PATH}" protobuild --quiet ${NON_API_PACKAGES})
182-
find v2 -name '*.pb.go' -exec sh -c 'f={}; mkdir -p $$(dirname "$${f#v2/}"); echo mv $$f $${f#v2/}; mv $$f $${f#v2/}' \;
183180
@mv ${TMPDIR}/vendor ${ROOTDIR}
184181
@rm -rf ${TMPDIR} v2
185-
go-fix-acronym -w -a '^Os' $(shell find api/ core/runtime/ -name '*.pb.go')
186-
go-fix-acronym -w -a '(Id|Io|Uuid|Os)$$' $(shell find api/ core/runtime/ -name '*.pb.go')
182+
go-fix-acronym -w -a '^Os' $(shell find api/ -name '*.pb.go')
183+
go-fix-acronym -w -a '(Id|Io|Uuid|Os)$$' $(shell find api/ -name '*.pb.go')
187184

188185
check-protos: protos ## check if protobufs needs to be generated again
189186
@echo "$(WHALE) $@"
@@ -474,17 +471,18 @@ vendor: ## ensure all the go.mod/go.sum files are up-to-date including vendor/ d
474471
@$(GO) mod tidy
475472
@$(GO) mod vendor
476473
@$(GO) mod verify
477-
#@(cd ${ROOTDIR}/integration/client && ${GO} mod tidy)
474+
@(cd ${ROOTDIR}/api && ${GO} mod tidy)
478475

479476
verify-vendor: ## verify if all the go.mod/go.sum files are up-to-date
480477
@echo "$(WHALE) $@"
481478
$(eval TMPDIR := $(shell mktemp -d))
482479
@cp -R ${ROOTDIR} ${TMPDIR}
483480
@(cd ${TMPDIR}/containerd && ${GO} mod tidy)
484-
@(cd ${TMPDIR}/containerd/integration/client && ${GO} mod tidy)
481+
@(cd ${TMPDIR}/containerd && ${GO} mod vendor)
482+
@(cd ${TMPDIR}/containerd && ${GO} mod verify)
483+
@(cd ${TMPDIR}/containerd/api && ${GO} mod tidy)
485484
@diff -r -u -q ${ROOTDIR} ${TMPDIR}/containerd
486485
@rm -rf ${TMPDIR}
487-
#@${ROOTDIR}/script/verify-go-modules.sh integration/client
488486

489487

490488
help: ## this help

Protobuild.toml

Lines changed: 0 additions & 21 deletions
This file was deleted.

RELEASES.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,36 @@ and new fields on messages may be added if they are optional.
278278
to the API by having a diff that the CI can run. These files are not intended to be
279279
consumed or used by clients.
280280

281+
As of containerd 2.0, the API version diverges from the main containerd version.
282+
While containerd 2.0 is a _major_ version jump for containerd, the API will remain
283+
on 1.x to remain backwards compatible with prior releases and existing clients.
284+
The 2.0 release adds the API to a separate Go module which can remain as the
285+
`github.com/containerd/containerd/api` Go package and imported separately from the
286+
rest of containerd.
287+
288+
The API minor version will continue to be incremented for each major and minor
289+
version release of containerd. However, the API is tagged directly out of the
290+
main branch with the minor version incrementing earlier in the next release cycle
291+
rather than at the end. This means that after the containerd 2.0 release, the next
292+
API change is tagged as `api/v1.9.0` prior to any containerd 2.1 release. The
293+
latest API version should be backported to all supported versions and patch
294+
releases for prior API versions should be avoided if possible.
295+
296+
297+
| Containerd Version | API Version at Release |
298+
|--------------------|------------------------|
299+
| v1.0 | 1.0 |
300+
| v1.1 | 1.1 |
301+
| v1.2 | 1.2 |
302+
| v1.3 | 1.3 |
303+
| v1.4 | 1.4 |
304+
| v1.5 | 1.5 |
305+
| v1.6 | 1.6 |
306+
| v1.7 | 1.7 |
307+
| v2.0 | 1.8 |
308+
| next | 1.9 |
309+
310+
281311
### Metrics API
282312

283313
The metrics API that outputs prometheus style metrics will be versioned independently,

api/events/container.pb.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/events/container.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ package containerd.events;
2121
import "google/protobuf/any.proto";
2222
import "github.com/containerd/containerd/api/types/fieldpath.proto";
2323

24-
option go_package = "github.com/containerd/containerd/v2/api/events;events";
24+
option go_package = "github.com/containerd/containerd/api/events;events";
2525
option (containerd.types.fieldpath_all) = true;
2626

2727
message ContainerCreate {

api/events/content.pb.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/events/content.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package containerd.events;
2020

2121
import "github.com/containerd/containerd/api/types/fieldpath.proto";
2222

23-
option go_package = "github.com/containerd/containerd/v2/api/events;events";
23+
option go_package = "github.com/containerd/containerd/api/events;events";
2424
option (containerd.types.fieldpath_all) = true;
2525

2626
message ContentDelete {

api/events/image.pb.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/events/image.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package containerd.services.images.v1;
2020

2121
import "github.com/containerd/containerd/api/types/fieldpath.proto";
2222

23-
option go_package = "github.com/containerd/containerd/v2/api/events;events";
23+
option go_package = "github.com/containerd/containerd/api/events;events";
2424
option (containerd.types.fieldpath_all) = true;
2525

2626
message ImageCreate {

api/events/namespace.pb.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)