Add OSVersion to platform protobuf
It also extends the functions in api/types/platform_helpers.go Signed-off-by: kiashok <kiashok@microsoft.com>
This commit is contained in:
parent
d9cae66d8d
commit
5aa05481dd
@ -881,6 +881,13 @@ file {
|
|||||||
type: TYPE_STRING
|
type: TYPE_STRING
|
||||||
json_name: "variant"
|
json_name: "variant"
|
||||||
}
|
}
|
||||||
|
field {
|
||||||
|
name: "os_version"
|
||||||
|
number: 4
|
||||||
|
label: LABEL_OPTIONAL
|
||||||
|
type: TYPE_STRING
|
||||||
|
json_name: "osVersion"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
options {
|
options {
|
||||||
go_package: "github.com/containerd/containerd/v2/api/types;types"
|
go_package: "github.com/containerd/containerd/v2/api/types;types"
|
||||||
|
@ -45,6 +45,7 @@ type Platform struct {
|
|||||||
OS string `protobuf:"bytes,1,opt,name=os,proto3" json:"os,omitempty"`
|
OS string `protobuf:"bytes,1,opt,name=os,proto3" json:"os,omitempty"`
|
||||||
Architecture string `protobuf:"bytes,2,opt,name=architecture,proto3" json:"architecture,omitempty"`
|
Architecture string `protobuf:"bytes,2,opt,name=architecture,proto3" json:"architecture,omitempty"`
|
||||||
Variant string `protobuf:"bytes,3,opt,name=variant,proto3" json:"variant,omitempty"`
|
Variant string `protobuf:"bytes,3,opt,name=variant,proto3" json:"variant,omitempty"`
|
||||||
|
OSVersion string `protobuf:"bytes,4,opt,name=os_version,json=osVersion,proto3" json:"os_version,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Platform) Reset() {
|
func (x *Platform) Reset() {
|
||||||
@ -100,6 +101,13 @@ func (x *Platform) GetVariant() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Platform) GetOsVersion() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.OSVersion
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_github_com_containerd_containerd_api_types_platform_proto protoreflect.FileDescriptor
|
var File_github_com_containerd_containerd_api_types_platform_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_github_com_containerd_containerd_api_types_platform_proto_rawDesc = []byte{
|
var file_github_com_containerd_containerd_api_types_platform_proto_rawDesc = []byte{
|
||||||
@ -107,17 +115,19 @@ var file_github_com_containerd_containerd_api_types_platform_proto_rawDesc = []b
|
|||||||
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||||
0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x61,
|
0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x61,
|
||||||
0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f, 0x6e,
|
0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f, 0x6e,
|
||||||
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x58, 0x0a,
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x77, 0x0a,
|
||||||
0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x73, 0x18,
|
0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x73, 0x18,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63,
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63,
|
||||||
0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x18, 0x0a,
|
0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x18, 0x0a,
|
||||||
0x07, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
0x07, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||||
0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75,
|
0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x73, 0x5f, 0x76, 0x65,
|
||||||
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,
|
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x73, 0x56,
|
||||||
0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x61,
|
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||||
0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06,
|
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x70,
|
||||||
|
0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -26,4 +26,5 @@ message Platform {
|
|||||||
string os = 1;
|
string os = 1;
|
||||||
string architecture = 2;
|
string architecture = 2;
|
||||||
string variant = 3;
|
string variant = 3;
|
||||||
|
string os_version = 4;
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ func OCIPlatformToProto(platforms []oci.Platform) []*Platform {
|
|||||||
for i := range platforms {
|
for i := range platforms {
|
||||||
ap[i] = &Platform{
|
ap[i] = &Platform{
|
||||||
OS: platforms[i].OS,
|
OS: platforms[i].OS,
|
||||||
|
OSVersion: platforms[i].OSVersion,
|
||||||
Architecture: platforms[i].Architecture,
|
Architecture: platforms[i].Architecture,
|
||||||
Variant: platforms[i].Variant,
|
Variant: platforms[i].Variant,
|
||||||
}
|
}
|
||||||
@ -39,6 +40,7 @@ func OCIPlatformFromProto(platforms []*Platform) []oci.Platform {
|
|||||||
for i := range platforms {
|
for i := range platforms {
|
||||||
op[i] = oci.Platform{
|
op[i] = oci.Platform{
|
||||||
OS: platforms[i].OS,
|
OS: platforms[i].OS,
|
||||||
|
OSVersion: platforms[i].OSVersion,
|
||||||
Architecture: platforms[i].Architecture,
|
Architecture: platforms[i].Architecture,
|
||||||
Variant: platforms[i].Variant,
|
Variant: platforms[i].Variant,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user