mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update kubernetes dep to 1.24.0
As kubernetes 1.24.0 is released, updating kubernetes dependencies to 1.24.0 updates: #3086 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
fc1529f268
commit
c4f79d455f
31
vendor/k8s.io/utils/pointer/pointer.go
generated
vendored
31
vendor/k8s.io/utils/pointer/pointer.go
generated
vendored
@ -19,6 +19,7 @@ package pointer
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"time"
|
||||
)
|
||||
|
||||
// AllPtrFieldsNil tests whether all pointer fields in a struct are nil. This is useful when,
|
||||
@ -184,7 +185,7 @@ func StringEqual(a, b *string) bool {
|
||||
return *a == *b
|
||||
}
|
||||
|
||||
// Float32 returns a pointer to the a float32.
|
||||
// Float32 returns a pointer to a float32.
|
||||
func Float32(i float32) *float32 {
|
||||
return &i
|
||||
}
|
||||
@ -214,7 +215,7 @@ func Float32Equal(a, b *float32) bool {
|
||||
return *a == *b
|
||||
}
|
||||
|
||||
// Float64 returns a pointer to the a float64.
|
||||
// Float64 returns a pointer to a float64.
|
||||
func Float64(i float64) *float64 {
|
||||
return &i
|
||||
}
|
||||
@ -243,3 +244,29 @@ func Float64Equal(a, b *float64) bool {
|
||||
}
|
||||
return *a == *b
|
||||
}
|
||||
|
||||
// Duration returns a pointer to a time.Duration.
|
||||
func Duration(d time.Duration) *time.Duration {
|
||||
return &d
|
||||
}
|
||||
|
||||
// DurationDeref dereferences the time.Duration ptr and returns it if not nil, or else
|
||||
// returns def.
|
||||
func DurationDeref(ptr *time.Duration, def time.Duration) time.Duration {
|
||||
if ptr != nil {
|
||||
return *ptr
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
// DurationEqual returns true if both arguments are nil or both arguments
|
||||
// dereference to the same value.
|
||||
func DurationEqual(a, b *time.Duration) bool {
|
||||
if (a == nil) != (b == nil) {
|
||||
return false
|
||||
}
|
||||
if a == nil {
|
||||
return true
|
||||
}
|
||||
return *a == *b
|
||||
}
|
||||
|
Reference in New Issue
Block a user