rebase: update kubernetes to v1.20.0

updated kubernetes packages to latest
release.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2020-12-17 17:58:29 +05:30
committed by mergify[bot]
parent 4abe128bd8
commit 83559144b1
1624 changed files with 247222 additions and 160270 deletions

View File

@ -22,7 +22,7 @@ import (
"github.com/prometheus/procfs"
"k8s.io/klog"
"k8s.io/klog/v2"
)
var processStartTime = NewGaugeVec(
@ -43,6 +43,12 @@ func RegisterProcessStartTime(registrationFunc func(Registerable) error) error {
klog.Errorf("Could not get process start time, %v", err)
start = float64(time.Now().Unix())
}
// processStartTime is a lazy metric which only get initialized after registered.
// so we have to explicitly create it before setting the label value. Otherwise
// it is a noop.
if !processStartTime.IsCreated() {
processStartTime.initializeMetric()
}
processStartTime.WithLabelValues().Set(start)
return registrationFunc(processStartTime)
}
@ -54,7 +60,7 @@ func getProcessStart() (float64, error) {
return 0, err
}
if stat, err := p.NewStat(); err == nil {
if stat, err := p.Stat(); err == nil {
return stat.StartTime()
}
return 0, err