From 4c1290064317b17a6902e98d374c66e486516622 Mon Sep 17 00:00:00 2001 From: Masashi Honma Date: Tue, 13 Oct 2020 15:21:25 +0900 Subject: [PATCH] kube-eviction: Fix SI of process quantity Use DecimalSI instead of BinarySI because process count is decimal. Signed-off-by: Masashi Honma --- pkg/kubelet/eviction/helpers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kubelet/eviction/helpers.go b/pkg/kubelet/eviction/helpers.go index 8e795442fb7..3d479318482 100644 --- a/pkg/kubelet/eviction/helpers.go +++ b/pkg/kubelet/eviction/helpers.go @@ -758,8 +758,8 @@ func makeSignalObservations(summary *statsapi.Summary) (signalObservations, stat if rlimit.NumOfRunningProcesses != nil && rlimit.MaxPID != nil { available := int64(*rlimit.MaxPID) - int64(*rlimit.NumOfRunningProcesses) result[evictionapi.SignalPIDAvailable] = signalObservation{ - available: resource.NewQuantity(available, resource.BinarySI), - capacity: resource.NewQuantity(int64(*rlimit.MaxPID), resource.BinarySI), + available: resource.NewQuantity(available, resource.DecimalSI), + capacity: resource.NewQuantity(int64(*rlimit.MaxPID), resource.DecimalSI), time: rlimit.Time, } }