features.go 5.0 KB

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