|
1 | | -// Package features provides the JSON structure that is printed by `runc features` (since runc v1.1.0). |
2 | | -// The types in this package are experimental and subject to change. |
| 1 | +// Package features provides the annotations for [github.com/opencontainers/runtime-spec/specs-go/features]. |
3 | 2 | package features |
4 | 3 |
|
5 | | -// Features represents the supported features of the runtime. |
6 | | -type Features struct { |
7 | | - // OCIVersionMin is the minimum OCI Runtime Spec version recognized by the runtime, e.g., "1.0.0". |
8 | | - OCIVersionMin string `json:"ociVersionMin,omitempty"` |
9 | | - |
10 | | - // OCIVersionMax is the maximum OCI Runtime Spec version recognized by the runtime, e.g., "1.0.2-dev". |
11 | | - OCIVersionMax string `json:"ociVersionMax,omitempty"` |
12 | | - |
13 | | - // Hooks is the list of the recognized hook names, e.g., "createRuntime". |
14 | | - // Nil value means "unknown", not "no support for any hook". |
15 | | - Hooks []string `json:"hooks,omitempty"` |
16 | | - |
17 | | - // MountOptions is the list of the recognized mount options, e.g., "ro". |
18 | | - // Nil value means "unknown", not "no support for any mount option". |
19 | | - // This list does not contain filesystem-specific options passed to mount(2) syscall as (const void *). |
20 | | - MountOptions []string `json:"mountOptions,omitempty"` |
21 | | - |
22 | | - // Linux is specific to Linux. |
23 | | - Linux *Linux `json:"linux,omitempty"` |
24 | | - |
25 | | - // Annotations contains implementation-specific annotation strings, |
26 | | - // such as the implementation version, and third-party extensions. |
27 | | - Annotations map[string]string `json:"annotations,omitempty"` |
28 | | -} |
29 | | - |
30 | | -// Linux is specific to Linux. |
31 | | -type Linux struct { |
32 | | - // Namespaces is the list of the recognized namespaces, e.g., "mount". |
33 | | - // Nil value means "unknown", not "no support for any namespace". |
34 | | - Namespaces []string `json:"namespaces,omitempty"` |
35 | | - |
36 | | - // Capabilities is the list of the recognized capabilities , e.g., "CAP_SYS_ADMIN". |
37 | | - // Nil value means "unknown", not "no support for any capability". |
38 | | - Capabilities []string `json:"capabilities,omitempty"` |
39 | | - |
40 | | - Cgroup *Cgroup `json:"cgroup,omitempty"` |
41 | | - Seccomp *Seccomp `json:"seccomp,omitempty"` |
42 | | - Apparmor *Apparmor `json:"apparmor,omitempty"` |
43 | | - Selinux *Selinux `json:"selinux,omitempty"` |
44 | | -} |
45 | | - |
46 | | -// Seccomp represents the "seccomp" field. |
47 | | -type Seccomp struct { |
48 | | - // Enabled is true if seccomp support is compiled in. |
49 | | - // Nil value means "unknown", not "false". |
50 | | - Enabled *bool `json:"enabled,omitempty"` |
51 | | - |
52 | | - // Actions is the list of the recognized actions, e.g., "SCMP_ACT_NOTIFY". |
53 | | - // Nil value means "unknown", not "no support for any action". |
54 | | - Actions []string `json:"actions,omitempty"` |
55 | | - |
56 | | - // Operators is the list of the recognized operators, e.g., "SCMP_CMP_NE". |
57 | | - // Nil value means "unknown", not "no support for any operator". |
58 | | - Operators []string `json:"operators,omitempty"` |
59 | | - |
60 | | - // Archs is the list of the recognized archs, e.g., "SCMP_ARCH_X86_64". |
61 | | - // Nil value means "unknown", not "no support for any arch". |
62 | | - Archs []string `json:"archs,omitempty"` |
63 | | - |
64 | | - // KnownFlags is the list of the recognized filter flags, e.g., "SECCOMP_FILTER_FLAG_LOG". |
65 | | - // Nil value means "unknown", not "no flags are recognized". |
66 | | - KnownFlags []string `json:"knownFlags,omitempty"` |
67 | | - |
68 | | - // SupportedFlags is the list of the supported filter flags, e.g., "SECCOMP_FILTER_FLAG_LOG". |
69 | | - // This list may be a subset of KnownFlags due to some flags |
70 | | - // not supported by the current kernel and/or libseccomp. |
71 | | - // Nil value means "unknown", not "no flags are supported". |
72 | | - SupportedFlags []string `json:"supportedFlags,omitempty"` |
73 | | -} |
74 | | - |
75 | | -// Apparmor represents the "apparmor" field. |
76 | | -type Apparmor struct { |
77 | | - // Enabled is true if AppArmor support is compiled in. |
78 | | - // Unrelated to whether the host supports AppArmor or not. |
79 | | - // Nil value means "unknown", not "false". |
80 | | - // Always true in the current version of runc. |
81 | | - Enabled *bool `json:"enabled,omitempty"` |
82 | | -} |
83 | | - |
84 | | -// Selinux represents the "selinux" field. |
85 | | -type Selinux struct { |
86 | | - // Enabled is true if SELinux support is compiled in. |
87 | | - // Unrelated to whether the host supports SELinux or not. |
88 | | - // Nil value means "unknown", not "false". |
89 | | - // Always true in the current version of runc. |
90 | | - Enabled *bool `json:"enabled,omitempty"` |
91 | | -} |
92 | | - |
93 | | -// Cgroup represents the "cgroup" field. |
94 | | -type Cgroup struct { |
95 | | - // V1 represents whether Cgroup v1 support is compiled in. |
96 | | - // Unrelated to whether the host uses cgroup v1 or not. |
97 | | - // Nil value means "unknown", not "false". |
98 | | - // Always true in the current version of runc. |
99 | | - V1 *bool `json:"v1,omitempty"` |
100 | | - |
101 | | - // V2 represents whether Cgroup v2 support is compiled in. |
102 | | - // Unrelated to whether the host uses cgroup v2 or not. |
103 | | - // Nil value means "unknown", not "false". |
104 | | - // Always true in the current version of runc. |
105 | | - V2 *bool `json:"v2,omitempty"` |
106 | | - |
107 | | - // Systemd represents whether systemd-cgroup support is compiled in. |
108 | | - // Unrelated to whether the host uses systemd or not. |
109 | | - // Nil value means "unknown", not "false". |
110 | | - // Always true in the current version of runc. |
111 | | - Systemd *bool `json:"systemd,omitempty"` |
112 | | - |
113 | | - // SystemdUser represents whether user-scoped systemd-cgroup support is compiled in. |
114 | | - // Unrelated to whether the host uses systemd or not. |
115 | | - // Nil value means "unknown", not "false". |
116 | | - // Always true in the current version of runc. |
117 | | - SystemdUser *bool `json:"systemdUser,omitempty"` |
118 | | -} |
119 | | - |
120 | 4 | const ( |
121 | 5 | // AnnotationRuncVersion represents the version of runc, e.g., "1.2.3", "1.2.3+dev", "1.2.3-rc.4.", "1.2.3-rc.4+dev". |
122 | 6 | // Third party implementations such as crun and runsc MAY use this annotation to report the most compatible runc version, |
|
0 commit comments