Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,15 @@ protos: bin/protoc-gen-go-fieldpath bin/go-buildtag
@test -z "$$(git status --short | grep "api/next.txtpb" | tee /dev/stderr)" || \
$(GO) mod edit -replace=github.com/containerd/containerd/api=./api

check-protos: protos ## check if protobufs needs to be generated again
check-protos: ## check if protobufs needs to be generated again
@echo "$(WHALE) $@"
@test -z "$$(git status --short | grep ".pb.go" | tee /dev/stderr)" || \
((git diff | cat) && \
(echo "$(ONI) please run 'make protos' when making changes to proto files" && false))
@(cd api && buf format --diff --exit-code --exclude-path vendor \
$(if $(GITHUB_ACTIONS),--error-format github-actions)) || \
(echo "$(ONI) please run 'make protos' when making changes to proto files" && false)

proto-fmt: ## check format of proto files
proto-fmt: ## format 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)" || \
(echo "$(ONI) please indent proto files with tabs only" && false)
@cd api && buf format --write --exclude-path vendor

build: ## build the go packages
@echo "$(WHALE) $@"
Expand Down
4 changes: 4 additions & 0 deletions api/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.proto]
indent_size = 2
indent_style = space
insert_final_newline = true
44 changes: 22 additions & 22 deletions api/events/container.proto
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
Copyright The containerd Authors.
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
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
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.
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.
*/

syntax = "proto3";
Expand All @@ -25,22 +25,22 @@ option go_package = "github.com/containerd/containerd/api/events;events";
option (containerd.types.fieldpath_all) = true;

message ContainerCreate {
string id = 1;
string image = 2;
message Runtime {
string name = 1;
google.protobuf.Any options = 2;
}
Runtime runtime = 3;
string id = 1;
string image = 2;
message Runtime {
string name = 1;
google.protobuf.Any options = 2;
}
Runtime runtime = 3;
}

message ContainerUpdate {
string id = 1;
string image = 2;
map<string, string> labels = 3;
string snapshot_key = 4;
string id = 1;
string image = 2;
map<string, string> labels = 3;
string snapshot_key = 4;
}

message ContainerDelete {
string id = 1;
string id = 1;
}
26 changes: 13 additions & 13 deletions api/events/content.proto
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
Copyright The containerd Authors.
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
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
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.
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.
*/

syntax = "proto3";
Expand All @@ -24,10 +24,10 @@ option go_package = "github.com/containerd/containerd/api/events;events";
option (containerd.types.fieldpath_all) = true;

message ContentCreate {
string digest = 1;
int64 size = 2;
string digest = 1;
int64 size = 2;
}

message ContentDelete {
string digest = 1;
string digest = 1;
}
30 changes: 15 additions & 15 deletions api/events/image.proto
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
Copyright The containerd Authors.
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
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
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.
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.
*/

syntax = "proto3";
Expand All @@ -24,15 +24,15 @@ option go_package = "github.com/containerd/containerd/api/events;events";
option (containerd.types.fieldpath_all) = true;

message ImageCreate {
string name = 1;
map<string, string> labels = 2;
string name = 1;
map<string, string> labels = 2;
}

message ImageUpdate {
string name = 1;
map<string, string> labels = 2;
string name = 1;
map<string, string> labels = 2;
}

message ImageDelete {
string name = 1;
string name = 1;
}
30 changes: 15 additions & 15 deletions api/events/namespace.proto
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
Copyright The containerd Authors.
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
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
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.
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.
*/

syntax = "proto3";
Expand All @@ -24,15 +24,15 @@ option go_package = "github.com/containerd/containerd/api/events;events";
option (containerd.types.fieldpath_all) = true;

message NamespaceCreate {
string name = 1;
map<string, string> labels = 2;
string name = 1;
map<string, string> labels = 2;
}

message NamespaceUpdate {
string name = 1;
map<string, string> labels = 2;
string name = 1;
map<string, string> labels = 2;
}

message NamespaceDelete {
string name = 1;
string name = 1;
}
30 changes: 15 additions & 15 deletions api/events/sandbox.proto
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
Copyright The containerd Authors.
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
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
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.
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.
*/

syntax = "proto3";
Expand All @@ -23,15 +23,15 @@ import "google/protobuf/timestamp.proto";
option go_package = "github.com/containerd/containerd/api/events;events";

message SandboxCreate {
string sandbox_id = 1;
string sandbox_id = 1;
}

message SandboxStart {
string sandbox_id = 1;
string sandbox_id = 1;
}

message SandboxExit {
string sandbox_id = 1;
uint32 exit_status = 2;
google.protobuf.Timestamp exited_at = 3;
string sandbox_id = 1;
uint32 exit_status = 2;
google.protobuf.Timestamp exited_at = 3;
}
36 changes: 18 additions & 18 deletions api/events/snapshot.proto
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
Copyright The containerd Authors.
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
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
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.
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.
*/

syntax = "proto3";
Expand All @@ -24,18 +24,18 @@ option go_package = "github.com/containerd/containerd/api/events;events";
option (containerd.types.fieldpath_all) = true;

message SnapshotPrepare {
string key = 1;
string parent = 2;
string snapshotter = 5;
string key = 1;
string parent = 2;
string snapshotter = 5;
}

message SnapshotCommit {
string key = 1;
string name = 2;
string snapshotter = 5;
string key = 1;
string name = 2;
string snapshotter = 5;
}

message SnapshotRemove {
string key = 1;
string snapshotter = 5;
string key = 1;
string snapshotter = 5;
}
Loading
Loading