Skip to content

Commit

Permalink
Sandbox: Add annotations to CreateSandbox surface
Browse files Browse the repository at this point in the history
An oft employed scheme for a lot of our APIs is to include an
annotations field which is just a map of string to string. This
usually allows folks using the API to send over metadata or auxiliary
information without needing to get a new field added (especially where
the field might not make sense for it to be a standalone field). I think
having annotations for CreateSandbox make sense for this same use case.

Signed-off-by: Danny Canter <danny@dcantah.dev>
  • Loading branch information
dcantah committed Aug 12, 2023
1 parent 70a2c95 commit 939ccbe
Show file tree
Hide file tree
Showing 5 changed files with 554 additions and 454 deletions.
56 changes: 56 additions & 0 deletions api/next.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,34 @@ file {
type: TYPE_STRING
json_name: "netnsPath"
}
field {
name: "annotations"
number: 6
label: LABEL_REPEATED
type: TYPE_MESSAGE
type_name: ".containerd.runtime.sandbox.v1.CreateSandboxRequest.AnnotationsEntry"
json_name: "annotations"
}
nested_type {
name: "AnnotationsEntry"
field {
name: "key"
number: 1
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "key"
}
field {
name: "value"
number: 2
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "value"
}
options {
map_entry: true
}
}
}
message_type {
name: "CreateSandboxResponse"
Expand Down Expand Up @@ -5145,6 +5173,34 @@ file {
type: TYPE_STRING
json_name: "netnsPath"
}
field {
name: "annotations"
number: 5
label: LABEL_REPEATED
type: TYPE_MESSAGE
type_name: ".containerd.services.sandbox.v1.ControllerCreateRequest.AnnotationsEntry"
json_name: "annotations"
}
nested_type {
name: "AnnotationsEntry"
field {
name: "key"
number: 1
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "key"
}
field {
name: "value"
number: 2
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "value"
}
options {
map_entry: true
}
}
}
message_type {
name: "ControllerCreateResponse"
Expand Down
Loading

0 comments on commit 939ccbe

Please sign in to comment.