features.go 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. // PotentiallyUnsafeConfigAnnotations the list of the potential unsafe annotations
  22. // that may appear in `config.json`.
  23. //
  24. // A value that ends with "." is interpreted as a prefix of annotations.
  25. PotentiallyUnsafeConfigAnnotations []string `json:"potentiallyUnsafeConfigAnnotations,omitempty"`
  26. }
  27. // Linux is specific to Linux.
  28. type Linux struct {
  29. // Namespaces is the list of the recognized namespaces, e.g., "mount".
  30. // Nil value means "unknown", not "no support for any namespace".
  31. Namespaces []string `json:"namespaces,omitempty"`
  32. // Capabilities is the list of the recognized capabilities , e.g., "CAP_SYS_ADMIN".
  33. // Nil value means "unknown", not "no support for any capability".
  34. Capabilities []string `json:"capabilities,omitempty"`
  35. Cgroup *Cgroup `json:"cgroup,omitempty"`
  36. Seccomp *Seccomp `json:"seccomp,omitempty"`
  37. Apparmor *Apparmor `json:"apparmor,omitempty"`
  38. Selinux *Selinux `json:"selinux,omitempty"`
  39. IntelRdt *IntelRdt `json:"intelRdt,omitempty"`
  40. MountExtensions *MountExtensions `json:"mountExtensions,omitempty"`
  41. }
  42. // Cgroup represents the "cgroup" field.
  43. type Cgroup struct {
  44. // V1 represents whether Cgroup v1 support is compiled in.
  45. // Unrelated to whether the host uses cgroup v1 or not.
  46. // Nil value means "unknown", not "false".
  47. V1 *bool `json:"v1,omitempty"`
  48. // V2 represents whether Cgroup v2 support is compiled in.
  49. // Unrelated to whether the host uses cgroup v2 or not.
  50. // Nil value means "unknown", not "false".
  51. V2 *bool `json:"v2,omitempty"`
  52. // Systemd represents whether systemd-cgroup support is compiled in.
  53. // Unrelated to whether the host uses systemd or not.
  54. // Nil value means "unknown", not "false".
  55. Systemd *bool `json:"systemd,omitempty"`
  56. // SystemdUser represents whether user-scoped systemd-cgroup support is compiled in.
  57. // Unrelated to whether the host uses systemd or not.
  58. // Nil value means "unknown", not "false".
  59. SystemdUser *bool `json:"systemdUser,omitempty"`
  60. // Rdma represents whether RDMA cgroup support is compiled in.
  61. // Unrelated to whether the host supports RDMA or not.
  62. // Nil value means "unknown", not "false".
  63. Rdma *bool `json:"rdma,omitempty"`
  64. }
  65. // Seccomp represents the "seccomp" field.
  66. type Seccomp struct {
  67. // Enabled is true if seccomp support is compiled in.
  68. // Nil value means "unknown", not "false".
  69. Enabled *bool `json:"enabled,omitempty"`
  70. // Actions is the list of the recognized actions, e.g., "SCMP_ACT_NOTIFY".
  71. // Nil value means "unknown", not "no support for any action".
  72. Actions []string `json:"actions,omitempty"`
  73. // Operators is the list of the recognized operators, e.g., "SCMP_CMP_NE".
  74. // Nil value means "unknown", not "no support for any operator".
  75. Operators []string `json:"operators,omitempty"`
  76. // Archs is the list of the recognized archs, e.g., "SCMP_ARCH_X86_64".
  77. // Nil value means "unknown", not "no support for any arch".
  78. Archs []string `json:"archs,omitempty"`
  79. // KnownFlags is the list of the recognized filter flags, e.g., "SECCOMP_FILTER_FLAG_LOG".
  80. // Nil value means "unknown", not "no flags are recognized".
  81. KnownFlags []string `json:"knownFlags,omitempty"`
  82. // SupportedFlags is the list of the supported filter flags, e.g., "SECCOMP_FILTER_FLAG_LOG".
  83. // This list may be a subset of KnownFlags due to some flags
  84. // not supported by the current kernel and/or libseccomp.
  85. // Nil value means "unknown", not "no flags are supported".
  86. SupportedFlags []string `json:"supportedFlags,omitempty"`
  87. }
  88. // Apparmor represents the "apparmor" field.
  89. type Apparmor struct {
  90. // Enabled is true if AppArmor support is compiled in.
  91. // Unrelated to whether the host supports AppArmor or not.
  92. // Nil value means "unknown", not "false".
  93. Enabled *bool `json:"enabled,omitempty"`
  94. }
  95. // Selinux represents the "selinux" field.
  96. type Selinux struct {
  97. // Enabled is true if SELinux support is compiled in.
  98. // Unrelated to whether the host supports SELinux or not.
  99. // Nil value means "unknown", not "false".
  100. Enabled *bool `json:"enabled,omitempty"`
  101. }
  102. // IntelRdt represents the "intelRdt" field.
  103. type IntelRdt struct {
  104. // Enabled is true if Intel RDT support is compiled in.
  105. // Unrelated to whether the host supports Intel RDT or not.
  106. // Nil value means "unknown", not "false".
  107. Enabled *bool `json:"enabled,omitempty"`
  108. }
  109. // MountExtensions represents the "mountExtensions" field.
  110. type MountExtensions struct {
  111. // IDMap represents the status of idmap mounts support.
  112. IDMap *IDMap `json:"idmap,omitempty"`
  113. }
  114. type IDMap struct {
  115. // Enabled represents whether idmap mounts supports is compiled in.
  116. // Unrelated to whether the host supports it or not.
  117. // Nil value means "unknown", not "false".
  118. Enabled *bool `json:"enabled,omitempty"`
  119. }