mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
kubelet: RuntimeHandler: add SupportsRecursiveReadOnlyMounts
For KEP-3857: Recursive Read-only (RRO) mounts Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
parent
27f24a62e3
commit
76081a10c2
@ -562,6 +562,9 @@ func (r *RuntimeStatus) String() string {
|
|||||||
type RuntimeHandler struct {
|
type RuntimeHandler struct {
|
||||||
// Name is the handler name.
|
// Name is the handler name.
|
||||||
Name string
|
Name string
|
||||||
|
// SupportsRecursiveReadOnlyMounts is true if the handler has support for
|
||||||
|
// recursive read-only mounts.
|
||||||
|
SupportsRecursiveReadOnlyMounts bool
|
||||||
// SupportsUserNamespaces is true if the handler has support for
|
// SupportsUserNamespaces is true if the handler has support for
|
||||||
// user namespaces.
|
// user namespaces.
|
||||||
SupportsUserNamespaces bool
|
SupportsUserNamespaces bool
|
||||||
@ -569,7 +572,8 @@ type RuntimeHandler struct {
|
|||||||
|
|
||||||
// String formats the runtime handler into human readable string.
|
// String formats the runtime handler into human readable string.
|
||||||
func (h *RuntimeHandler) String() string {
|
func (h *RuntimeHandler) String() string {
|
||||||
return fmt.Sprintf("Name=%s SupportsUserNamespaces: %v", h.Name, h.SupportsUserNamespaces)
|
return fmt.Sprintf("Name=%s SupportsRecursiveReadOnlyMounts: %v SupportsUserNamespaces: %v",
|
||||||
|
h.Name, h.SupportsRecursiveReadOnlyMounts, h.SupportsUserNamespaces)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RuntimeCondition contains condition information for the runtime.
|
// RuntimeCondition contains condition information for the runtime.
|
||||||
|
@ -221,13 +221,16 @@ func toKubeRuntimeStatus(status *runtimeapi.RuntimeStatus, handlers []*runtimeap
|
|||||||
}
|
}
|
||||||
retHandlers := make([]kubecontainer.RuntimeHandler, len(handlers))
|
retHandlers := make([]kubecontainer.RuntimeHandler, len(handlers))
|
||||||
for i, h := range handlers {
|
for i, h := range handlers {
|
||||||
|
supportsRRO := false
|
||||||
supportsUserns := false
|
supportsUserns := false
|
||||||
if h.Features != nil {
|
if h.Features != nil {
|
||||||
|
supportsRRO = h.Features.RecursiveReadOnlyMounts
|
||||||
supportsUserns = h.Features.UserNamespaces
|
supportsUserns = h.Features.UserNamespaces
|
||||||
}
|
}
|
||||||
retHandlers[i] = kubecontainer.RuntimeHandler{
|
retHandlers[i] = kubecontainer.RuntimeHandler{
|
||||||
Name: h.Name,
|
Name: h.Name,
|
||||||
SupportsUserNamespaces: supportsUserns,
|
SupportsRecursiveReadOnlyMounts: supportsRRO,
|
||||||
|
SupportsUserNamespaces: supportsUserns,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &kubecontainer.RuntimeStatus{Conditions: conditions, Handlers: retHandlers}
|
return &kubecontainer.RuntimeStatus{Conditions: conditions, Handlers: retHandlers}
|
||||||
|
Loading…
Reference in New Issue
Block a user