mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Attach/Detach Controller Kubelet Changes
This PR contains Kubelet changes to enable attach/detach controller control. * It introduces a new "enable-controller-attach-detach" kubelet flag to enable control by controller. Default enabled. * It removes all references "SafeToDetach" annoation from controller. * It adds the new VolumesInUse field to the Node Status API object. * It modifies the controller to use VolumesInUse instead of SafeToDetach annotation to gate detachment. * There is a bug in node-problem-detector that causes VolumesInUse to get reset every 30 seconds. Issue https://github.com/kubernetes/node-problem-detector/issues/9 opened to fix that.
This commit is contained in:
@@ -3388,6 +3388,15 @@ func autoConvert_v1_NodeStatus_To_api_NodeStatus(in *NodeStatus, out *api.NodeSt
|
||||
} else {
|
||||
out.Images = nil
|
||||
}
|
||||
if in.VolumesInUse != nil {
|
||||
in, out := &in.VolumesInUse, &out.VolumesInUse
|
||||
*out = make([]api.UniqueDeviceName, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = api.UniqueDeviceName((*in)[i])
|
||||
}
|
||||
} else {
|
||||
out.VolumesInUse = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -3462,6 +3471,15 @@ func autoConvert_api_NodeStatus_To_v1_NodeStatus(in *api.NodeStatus, out *NodeSt
|
||||
} else {
|
||||
out.Images = nil
|
||||
}
|
||||
if in.VolumesInUse != nil {
|
||||
in, out := &in.VolumesInUse, &out.VolumesInUse
|
||||
*out = make([]UniqueDeviceName, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = UniqueDeviceName((*in)[i])
|
||||
}
|
||||
} else {
|
||||
out.VolumesInUse = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user