Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ CVE-2022-1996

#dpkg vulnerability in ubuntu
CVE-2022-1304
CVE-2022-2509
7 changes: 6 additions & 1 deletion source/plugins/ruby/KubernetesApiClient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,13 @@ def getMetricNumericValue(metricName, metricVal)
metricValue.chomp!("k")
metricValue = Float(metricValue) * 1000.0 ** 1
elsif (metricValue.end_with?("m"))
#original value before downcase ending with M is megabyte and value ending with m is milli-byte
Comment thread
pfrcks marked this conversation as resolved.
metricValue.chomp!("m")
metricValue = Float(metricValue) * 1000.0 ** 2
Comment thread
pfrcks marked this conversation as resolved.
if (metricVal.end_with?("M"))
metricValue = Float(metricValue) * 1000.0 ** 2
else
metricValue = Float(metricValue) / 1000.0
end
elsif (metricValue.end_with?("g"))
metricValue.chomp!("g")
metricValue = Float(metricValue) * 1000.0 ** 3
Expand Down