1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-25 06:33:56 +00:00

update to k8s v1.21 and go 1.16

This commit is contained in:
Kinara Shah
2021-04-29 14:07:38 -07:00
parent 3c0f955343
commit 9d49d88aaa
2297 changed files with 311411 additions and 121408 deletions

View File

@@ -81,6 +81,19 @@ func dateAgo(date interface{}) string {
return duration.String()
}
func duration(sec interface{}) string {
var n int64
switch value := sec.(type) {
default:
n = 0
case string:
n, _ = strconv.ParseInt(value, 10, 64)
case int64:
n = value
}
return (time.Duration(n) * time.Second).String()
}
func durationRound(duration interface{}) string {
var d time.Duration
switch duration := duration.(type) {