Skip to content

Commit

Permalink
Added Annotations to CDI Spec
Browse files Browse the repository at this point in the history
  • Loading branch information
zvonkok committed Oct 19, 2022
1 parent 5609688 commit b3af822
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
11 changes: 11 additions & 0 deletions schema/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
"Env": {
"$ref": "#/definitions/ArrayOfStrings"
},
"mapStringString": {
"type": "object",
"patternProperties": {
".{1,}": {
"type": "string"
}
}
},
"DeviceNode": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -128,6 +136,9 @@
}
}
}
},
"annotations": {
"$ref": "#/definitions/mapStringString"
}
}
}
6 changes: 6 additions & 0 deletions schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"description": "The kind of the device usually of the form 'vendor.com/device'",
"type": "string"
},
"annotations": {
"$ref": "defs.json#/definitions/annotations"
},
"devices": {
"type": "array",
"items": {
Expand All @@ -20,6 +23,9 @@
"description": "The name of the device",
"type": "string"
},
"annotations": {
"$ref": "defs.json#/definitions/annotations"
},
"containerEdits": {
"$ref": "defs.json#/definitions/containerEdits"
}
Expand Down
5 changes: 3 additions & 2 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ type Spec struct {

// Device is a "Device" a container runtime can add to a container
type Device struct {
Name string `json:"name"`
ContainerEdits ContainerEdits `json:"containerEdits"`
Name string `json:"name"`
Annotations map[string]string `json:"annotations"`
ContainerEdits ContainerEdits `json:"containerEdits"`
}

// ContainerEdits are edits a container runtime must make to the OCI spec to expose the device.
Expand Down

0 comments on commit b3af822

Please sign in to comment.