Sandbox: Add annotations to CreateSandbox surface

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>
This commit is contained in:
Danny Canter
2023-08-11 23:13:51 -07:00
parent 70a2c95ae8
commit 939ccbed42
5 changed files with 554 additions and 454 deletions

View File

@@ -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"
@@ -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"