@@ -4,69 +4,69 @@ import "os"
44
55// Spec is the base configuration for CDI
66type Spec struct {
7- Version string `json:"cdiVersion"`
8- Kind string `json:"kind"`
7+ Version string `json:"cdiVersion" yaml:"cdiVersion" `
8+ Kind string `json:"kind" yaml:"kind" `
99 // Annotations add meta information per CDI spec. Note these are CDI-specific and do not affect container metadata.
1010 // Added in v0.6.0.
11- Annotations map [string ]string `json:"annotations,omitempty"`
12- Devices []Device `json:"devices"`
13- ContainerEdits ContainerEdits `json:"containerEdits,omitempty"`
11+ Annotations map [string ]string `json:"annotations,omitempty" yaml:"annotations,omitempty" `
12+ Devices []Device `json:"devices" yaml:"devices" `
13+ ContainerEdits ContainerEdits `json:"containerEdits,omitempty" yaml:"containerEdits,omitempty" `
1414}
1515
1616// Device is a "Device" a container runtime can add to a container
1717type Device struct {
18- Name string `json:"name"`
18+ Name string `json:"name" yaml:"name" `
1919 // Annotations add meta information per device. Note these are CDI-specific and do not affect container metadata.
2020 // Added in v0.6.0.
21- Annotations map [string ]string `json:"annotations,omitempty"`
22- ContainerEdits ContainerEdits `json:"containerEdits"`
21+ Annotations map [string ]string `json:"annotations,omitempty" yaml:"annotations,omitempty" `
22+ ContainerEdits ContainerEdits `json:"containerEdits" yaml:"containerEdits" `
2323}
2424
2525// ContainerEdits are edits a container runtime must make to the OCI spec to expose the device.
2626type ContainerEdits struct {
27- Env []string `json:"env,omitempty"`
28- DeviceNodes []* DeviceNode `json:"deviceNodes,omitempty"`
29- Hooks []* Hook `json:"hooks,omitempty"`
30- Mounts []* Mount `json:"mounts,omitempty"`
31- IntelRdt * IntelRdt `json:"intelRdt,omitempty"` // Added in v0.7.0
32- AdditionalGIDs []uint32 `json:"additionalGids,omitempty"` // Added in v0.7.0
27+ Env []string `json:"env,omitempty" yaml:"env,omitempty" `
28+ DeviceNodes []* DeviceNode `json:"deviceNodes,omitempty" yaml:"deviceNodes,omitempty" `
29+ Hooks []* Hook `json:"hooks,omitempty" yaml:"hooks,omitempty" `
30+ Mounts []* Mount `json:"mounts,omitempty" yaml:"mounts,omitempty" `
31+ IntelRdt * IntelRdt `json:"intelRdt,omitempty" yaml:"intelRdt,omitempty" ` // Added in v0.7.0
32+ AdditionalGIDs []uint32 `json:"additionalGids,omitempty" yaml:"additionalGids,omitempty" ` // Added in v0.7.0
3333}
3434
3535// DeviceNode represents a device node that needs to be added to the OCI spec.
3636type DeviceNode struct {
37- Path string `json:"path"`
38- HostPath string `json:"hostPath,omitempty"` // Added in v0.5.0
39- Type string `json:"type,omitempty"`
40- Major int64 `json:"major,omitempty"`
41- Minor int64 `json:"minor,omitempty"`
42- FileMode * os.FileMode `json:"fileMode,omitempty"`
43- Permissions string `json:"permissions,omitempty"`
44- UID * uint32 `json:"uid,omitempty"`
45- GID * uint32 `json:"gid,omitempty"`
37+ Path string `json:"path" yaml:"path" `
38+ HostPath string `json:"hostPath,omitempty" yaml:"hostPath,omitempty" ` // Added in v0.5.0
39+ Type string `json:"type,omitempty" yaml:"type,omitempty" `
40+ Major int64 `json:"major,omitempty" yaml:"major,omitempty" `
41+ Minor int64 `json:"minor,omitempty" yaml:"minor,omitempty" `
42+ FileMode * os.FileMode `json:"fileMode,omitempty" yaml:"fileMode,omitempty" `
43+ Permissions string `json:"permissions,omitempty" yaml:"permissions,omitempty" `
44+ UID * uint32 `json:"uid,omitempty" yaml:"uid,omitempty" `
45+ GID * uint32 `json:"gid,omitempty" yaml:"gid,omitempty" `
4646}
4747
4848// Mount represents a mount that needs to be added to the OCI spec.
4949type Mount struct {
50- HostPath string `json:"hostPath"`
51- ContainerPath string `json:"containerPath"`
52- Options []string `json:"options,omitempty"`
53- Type string `json:"type,omitempty"` // Added in v0.4.0
50+ HostPath string `json:"hostPath" yaml:"hostPath" `
51+ ContainerPath string `json:"containerPath" yaml:"containerPath" `
52+ Options []string `json:"options,omitempty" yaml:"options,omitempty" `
53+ Type string `json:"type,omitempty" yaml:"type,omitempty" ` // Added in v0.4.0
5454}
5555
5656// Hook represents a hook that needs to be added to the OCI spec.
5757type Hook struct {
58- HookName string `json:"hookName"`
59- Path string `json:"path"`
60- Args []string `json:"args,omitempty"`
61- Env []string `json:"env,omitempty"`
62- Timeout * int `json:"timeout,omitempty"`
58+ HookName string `json:"hookName" yaml:"hookName" `
59+ Path string `json:"path" yaml:"path" `
60+ Args []string `json:"args,omitempty" yaml:"args,omitempty" `
61+ Env []string `json:"env,omitempty" yaml:"env,omitempty" `
62+ Timeout * int `json:"timeout,omitempty" yaml:"timeout,omitempty" `
6363}
6464
6565// IntelRdt describes the Linux IntelRdt parameters to set in the OCI spec.
6666type IntelRdt struct {
67- ClosID string `json:"closID,omitempty"`
68- L3CacheSchema string `json:"l3CacheSchema,omitempty"`
69- MemBwSchema string `json:"memBwSchema,omitempty"`
70- EnableCMT bool `json:"enableCMT,omitempty"`
71- EnableMBM bool `json:"enableMBM,omitempty"`
67+ ClosID string `json:"closID,omitempty" yaml:"closID,omitempty" `
68+ L3CacheSchema string `json:"l3CacheSchema,omitempty" yaml:"l3CacheSchema,omitempty" `
69+ MemBwSchema string `json:"memBwSchema,omitempty" yaml:"memBwSchema,omitempty" `
70+ EnableCMT bool `json:"enableCMT,omitempty" yaml:"enableCMT,omitempty" `
71+ EnableMBM bool `json:"enableMBM,omitempty" yaml:"enableMBM,omitempty" `
7272}
0 commit comments