Skip to content

Commit 3e9cace

Browse files
committed
Move runtimeoptions to api directory
Signed-off-by: Derek McGowan <[email protected]>
1 parent 4a45507 commit 3e9cace

File tree

10 files changed

+216
-199
lines changed

10 files changed

+216
-199
lines changed

Makefile

Lines changed: 2 additions & 4 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,11 @@ 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})
182180
find v2 -name '*.pb.go' -exec sh -c 'f={}; mkdir -p $$(dirname "$${f#v2/}"); echo mv $$f $${f#v2/}; mv $$f $${f#v2/}' \;
183181
@mv ${TMPDIR}/vendor ${ROOTDIR}
184182
@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')
183+
go-fix-acronym -w -a '^Os' $(shell find api/ -name '*.pb.go')
184+
go-fix-acronym -w -a '(Id|Io|Uuid|Os)$$' $(shell find api/ -name '*.pb.go')
187185

188186
check-protos: protos ## check if protobufs needs to be generated again
189187
@echo "$(WHALE) $@"

Protobuild.toml

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

api/next.pb.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7350,6 +7350,38 @@ file {
73507350
}
73517351
syntax: "proto3"
73527352
}
7353+
file {
7354+
name: "github.com/containerd/containerd/api/types/runtimeoptions/v1/api.proto"
7355+
package: "runtimeoptions.v1"
7356+
message_type {
7357+
name: "Options"
7358+
field {
7359+
name: "type_url"
7360+
number: 1
7361+
label: LABEL_OPTIONAL
7362+
type: TYPE_STRING
7363+
json_name: "typeUrl"
7364+
}
7365+
field {
7366+
name: "config_path"
7367+
number: 2
7368+
label: LABEL_OPTIONAL
7369+
type: TYPE_STRING
7370+
json_name: "configPath"
7371+
}
7372+
field {
7373+
name: "config_body"
7374+
number: 3
7375+
label: LABEL_OPTIONAL
7376+
type: TYPE_BYTES
7377+
json_name: "configBody"
7378+
}
7379+
}
7380+
options {
7381+
go_package: "github.com/containerd/containerd/v2/api/types/runtimeoptions/v1;runtimeoptions"
7382+
}
7383+
syntax: "proto3"
7384+
}
73537385
file {
73547386
name: "github.com/containerd/containerd/api/types/transfer/imagestore.proto"
73557387
package: "containerd.types.transfer"

api/types/runtimeoptions/v1/api.pb.go

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

pkg/runtimeoptions/v1/api.proto renamed to api/types/runtimeoptions/v1/api.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ syntax = "proto3";
33

44
package runtimeoptions.v1;
55

6-
option go_package = "github.com/containerd/containerd/v2/pkg/runtimeoptions/v1;runtimeoptions_v1";
6+
option go_package = "github.com/containerd/containerd/v2/api/types/runtimeoptions/v1;runtimeoptions";
77

88
message Options {
99
// TypeUrl specifies the type of the content inside the config file.

pkg/runtimeoptions/v1/doc.go renamed to api/types/runtimeoptions/v1/doc.go

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

17-
package runtimeoptions_v1 //nolint:revive // Ignore var-naming: don't use an underscore in package name (revive)
17+
package runtimeoptions

cmd/ctr/commands/commands_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"errors"
2323

2424
"github.com/containerd/containerd/v2/api/types/runc/options"
25-
runtimeoptions "github.com/containerd/containerd/v2/pkg/runtimeoptions/v1"
25+
runtimeoptions "github.com/containerd/containerd/v2/api/types/runtimeoptions/v1"
2626
"github.com/urfave/cli/v2"
2727
)
2828

contrib/v2-migrate.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ for GOFILE in $(find . -name "*.go" | grep -v "./vendor/" ); do
6565
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/metrics/$1$2"github.com\/containerd\/containerd\/v2\/core\/metrics/g' $GOFILE
6666
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/runtime/$1$2"github.com\/containerd\/containerd\/v2\/core\/runtime/g' $GOFILE
6767
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/core\/runtime\/v2\/runc\/options/$1$2"github.com\/containerd\/containerd\/v2\/api\/types\/runc\/options/g' $GOFILE
68+
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/pkg\/runtimeoptions/$1$2"github.com\/containerd\/containerd\/v2\/api\/types\/runtimeoptions/g' $GOFILE
6869

6970
# Migrate packages split out to their own repository
7071
perl -pi -e 's/([\t]|[ ]{2,8}|import )([_a-zA-Z0-9]+ )?"github\.com\/containerd\/containerd\/v2\/platforms/$1$2"github.com\/containerd\/platforms/g' $GOFILE

internal/cri/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import (
3030

3131
runhcsoptions "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options"
3232
runcoptions "github.com/containerd/containerd/v2/api/types/runc/options"
33+
runtimeoptions "github.com/containerd/containerd/v2/api/types/runtimeoptions/v1"
3334
"github.com/containerd/containerd/v2/internal/cri/annotations"
3435
"github.com/containerd/containerd/v2/pkg/deprecation"
35-
runtimeoptions "github.com/containerd/containerd/v2/pkg/runtimeoptions/v1"
3636
"github.com/containerd/containerd/v2/plugins"
3737
)
3838

0 commit comments

Comments
 (0)