Skip to content

Commit 7fe08c6

Browse files
authored
Merge pull request containerd#9733 from kiashok/platform-protobuf
Add OSVersion to platform protobuf
2 parents 69dff41 + 5aa0548 commit 7fe08c6

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ protos: bin/protoc-gen-go-fieldpath
182182
find v2 -name '*.pb.go' -exec sh -c 'f={}; mkdir -p $$(dirname "$${f#v2/}"); echo mv $$f $${f#v2/}; mv $$f $${f#v2/}' \;
183183
@mv ${TMPDIR}/vendor ${ROOTDIR}
184184
@rm -rf ${TMPDIR} v2
185+
go-fix-acronym -w -a '^Os' $(shell find api/ core/runtime/ -name '*.pb.go')
185186
go-fix-acronym -w -a '(Id|Io|Uuid|Os)$$' $(shell find api/ core/runtime/ -name '*.pb.go')
186187

187188
check-protos: protos ## check if protobufs needs to be generated again

api/next.pb.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,13 @@ file {
881881
type: TYPE_STRING
882882
json_name: "variant"
883883
}
884+
field {
885+
name: "os_version"
886+
number: 4
887+
label: LABEL_OPTIONAL
888+
type: TYPE_STRING
889+
json_name: "osVersion"
890+
}
884891
}
885892
options {
886893
go_package: "github.com/containerd/containerd/v2/api/types;types"

api/types/platform.pb.go

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

api/types/platform.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ message Platform {
2626
string os = 1;
2727
string architecture = 2;
2828
string variant = 3;
29+
string os_version = 4;
2930
}

api/types/platform_helpers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func OCIPlatformToProto(platforms []oci.Platform) []*Platform {
2525
for i := range platforms {
2626
ap[i] = &Platform{
2727
OS: platforms[i].OS,
28+
OSVersion: platforms[i].OSVersion,
2829
Architecture: platforms[i].Architecture,
2930
Variant: platforms[i].Variant,
3031
}
@@ -39,6 +40,7 @@ func OCIPlatformFromProto(platforms []*Platform) []oci.Platform {
3940
for i := range platforms {
4041
op[i] = oci.Platform{
4142
OS: platforms[i].OS,
43+
OSVersion: platforms[i].OSVersion,
4244
Architecture: platforms[i].Architecture,
4345
Variant: platforms[i].Variant,
4446
}

0 commit comments

Comments
 (0)