Skip to content

Commit

Permalink
Merge pull request containerd#10189 from dmcgowan/1.7-api-go-module
Browse files Browse the repository at this point in the history
[release/1.7] Add API go module
  • Loading branch information
dmcgowan authored Jun 19, 2024
2 parents 0a9ac76 + 3be919f commit 1fdc9a0
Show file tree
Hide file tree
Showing 159 changed files with 37,849 additions and 492 deletions.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ GOTEST ?= $(GO) test
OUTPUTDIR = $(join $(ROOTDIR), _output)
CRIDIR=$(OUTPUTDIR)/cri

.PHONY: clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install uninstall vendor release static-release mandir install-man genman install-cri-deps cri-release cri-cni-release cri-integration install-deps bin/cri-integration.test
.PHONY: clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install uninstall vendor release static-release mandir install-man genman install-cri-deps cri-release cri-cni-release cri-integration install-deps bin/cri-integration.test remove-replace clean-vendor
.DEFAULT: default

# Forcibly set the default goal to all, in case an include above brought in a rule definition.
Expand Down Expand Up @@ -180,6 +180,8 @@ protos: bin/protoc-gen-go-fieldpath
@mv ${TMPDIR}/vendor ${ROOTDIR}
@rm -rf ${TMPDIR}
go-fix-acronym -w -a '(Id|Io|Uuid|Os)$$' $(shell find api/ runtime/ -name '*.pb.go')
@test -z "$$(git status --short | grep "api/next.pb.txt" | tee /dev/stderr)" || \
$(GO) mod edit -replace=github.com/containerd/containerd/api=./api

check-protos: protos ## check if protobufs needs to be generated again
@echo "$(WHALE) $@"
Expand Down Expand Up @@ -470,23 +472,31 @@ root-coverage: ## generate coverage profiles for unit tests that require root
fi; \
done )

remove-replace:
@echo "$(WHALE) $@"
@$(GO) mod edit -dropreplace=github.com/containerd/containerd/api

vendor: ## ensure all the go.mod/go.sum files are up-to-date including vendor/ directory
@echo "$(WHALE) $@"
@$(GO) mod tidy
@$(GO) mod vendor
@$(GO) mod verify
@(cd ${ROOTDIR}/integration/client && ${GO} mod tidy)
@(cd ${ROOTDIR}/api && ${GO} mod tidy)

verify-vendor: ## verify if all the go.mod/go.sum files are up-to-date
@echo "$(WHALE) $@"
$(eval TMPDIR := $(shell mktemp -d))
@cp -R ${ROOTDIR} ${TMPDIR}
@(cd ${TMPDIR}/containerd && ${GO} mod tidy)
@(cd ${TMPDIR}/containerd/api && ${GO} mod tidy)
@(cd ${TMPDIR}/containerd/integration/client && ${GO} mod tidy)
@diff -r -u -q ${ROOTDIR} ${TMPDIR}/containerd
@rm -rf ${TMPDIR}
@${ROOTDIR}/script/verify-go-modules.sh integration/client

clean-vendor: remove-replace vendor


help: ## this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
77 changes: 38 additions & 39 deletions api/events/container.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/events/container.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ syntax = "proto3";
package containerd.events;

import "google/protobuf/any.proto";
import "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
import "github.com/containerd/containerd/api/types/fieldpath.proto";

option go_package = "github.com/containerd/containerd/api/events;events";
option (containerd.plugin.fieldpath_all) = true;
option (containerd.types.fieldpath_all) = true;

message ContainerCreate {
string id = 1;
Expand Down
22 changes: 11 additions & 11 deletions api/events/content.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/events/content.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ syntax = "proto3";

package containerd.events;

import "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
import "github.com/containerd/containerd/api/types/fieldpath.proto";

option go_package = "github.com/containerd/containerd/api/events;events";
option (containerd.plugin.fieldpath_all) = true;
option (containerd.types.fieldpath_all) = true;

message ContentDelete {
string digest = 1;
Expand Down
Loading

0 comments on commit 1fdc9a0

Please sign in to comment.