mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
populate the new node.status.nodeInfo.swapInfo field
Signed-off-by: Itamar Holder <iholder@redhat.com>
This commit is contained in:
parent
a9b0211409
commit
16871a1faa
@ -44,6 +44,7 @@ import (
|
||||
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
|
||||
"k8s.io/kubernetes/pkg/kubelet/events"
|
||||
netutils "k8s.io/utils/net"
|
||||
"k8s.io/utils/ptr"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
@ -354,6 +355,12 @@ func MachineInfo(nodeName string,
|
||||
// node status.
|
||||
node.Status.Capacity[v1.ResourceName(removedResource)] = *resource.NewQuantity(int64(0), resource.DecimalSI)
|
||||
}
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.NodeSwap) && info.SwapCapacity != 0 {
|
||||
node.Status.NodeInfo.Swap = &v1.NodeSwapStatus{
|
||||
Capacity: ptr.To(int64(info.SwapCapacity)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set Allocatable.
|
||||
|
Loading…
Reference in New Issue
Block a user