-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proto: Port *.proto to proto3 #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
syntax = "proto3"; | ||
|
||
package oci; | ||
|
||
import "google/protobuf/any.proto"; | ||
|
||
// Spec is the base configuration for the container. It specifies platform | ||
// independent configuration. | ||
message Spec { | ||
// Version is the version of the specification that is supported. | ||
optional string version = 1; | ||
string version = 1; | ||
// Platform is the host information for OS and Arch. | ||
optional Platform platform = 2; | ||
Platform platform = 2; | ||
// Process is the container's main process. | ||
optional Process process = 3; | ||
Process process = 3; | ||
// Root is the root information for the container's filesystem. | ||
optional Root root = 4; | ||
Root root = 4; | ||
// Hostname is the container's host name. | ||
optional string hostname = 5; | ||
string hostname = 5; | ||
// Mounts profile configuration for adding mounts to the container's | ||
// filesystem. | ||
repeated MountPoint mounts = 6; | ||
|
@@ -21,10 +25,10 @@ message Spec { | |
|
||
// LinuxSpec is the full specification for linux containers. | ||
message LinuxSpec { | ||
optional Spec spec = 1; | ||
Spec spec = 1; | ||
// LinuxConfig is platform specific configuration for linux based | ||
// containers. | ||
optional LinuxConfig linux_config = 2; | ||
LinuxConfig linux_config = 2; | ||
} | ||
|
||
// LinuxConfig contains platform specific configuration for linux based | ||
|
@@ -38,69 +42,54 @@ message LinuxConfig { | |
// container is created for. | ||
message Platform { | ||
// OS is the operating system. | ||
optional string os = 1; | ||
string os = 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since this is pretty static, and validation would be nice, it might be worth considering an enum:
|
||
// Arch is the architecture | ||
optional string arch = 2; | ||
string arch = 2; | ||
} | ||
|
||
// Process contains information to start a specific application inside the | ||
// container. | ||
message Process { | ||
// Terminal creates an interactive terminal for the container. | ||
optional bool terminal = 1; | ||
bool terminal = 1; | ||
// User specifies user information for the process. | ||
optional User user = 2; | ||
google.protobuf.Any user = 2; | ||
// Args specifies the binary and arguments for the application to | ||
// execute. | ||
repeated string args = 3; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment, arg |
||
// Env populates the process environment for the process. | ||
repeated string env = 4; | ||
// Cwd is the current working directory for the process and must be | ||
// relative to the container's root. | ||
optional string cwd = 5; | ||
} | ||
|
||
enum PlatformType { | ||
UNKNOWN = 0; | ||
LINUX = 1; | ||
} | ||
|
||
// User specifies user information for the process. | ||
message User { | ||
// Type so that receivers of this message can `switch` for the fields | ||
// expected | ||
optional PlatformType type = 1; | ||
|
||
//optional LinuxUser linux_type = 2; | ||
extensions 100 to 499; | ||
string cwd = 5; | ||
} | ||
|
||
// LinuxUser specifies linux specific user and group information for the | ||
// container's main process. | ||
extend User { | ||
message LinuxUser { | ||
// Uid is the user id. | ||
optional int32 uid = 101; | ||
int32 uid = 101; | ||
// Gid is the group id. | ||
optional int32 gid = 102; | ||
int32 gid = 102; | ||
repeated int32 additional_gids = 103; | ||
} | ||
|
||
// Root contains information about the container's root filesystem on the host. | ||
message Root { | ||
// Path is the absolute path to the container's root filesystem. | ||
optional string path = 1; | ||
string path = 1; | ||
// Readonly makes the root filesystem for the container readonly before | ||
// the process is executed. | ||
optional bool readonly = 2; | ||
bool readonly = 2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might want to consider enum FileMode, but that may be getting silly |
||
} | ||
|
||
// MountPoint describes a directory that may be fullfilled by a mount in the | ||
// runtime.json. | ||
message MountPoint { | ||
// Name is a unique descriptive identifier for this mount point. | ||
optional string name = 1; | ||
string name = 1; | ||
// Path specifies the path of the mount. The path and child directories | ||
// MUST exist, a runtime MUST NOT create directories automatically to a | ||
// mount point. | ||
optional string path = 2; | ||
string path = 2; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if google is moving away from this, but the general protobuf standard has been to not use plural names for repeated fields, so this would be mount or mount_point.