mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update kubernetes to v1.25.0
update kubernetes to latest v1.25.0 release. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
f47839d73d
commit
e3bf375035
7
vendor/k8s.io/apimachinery/pkg/api/meta/help.go
generated
vendored
7
vendor/k8s.io/apimachinery/pkg/api/meta/help.go
generated
vendored
@ -40,7 +40,8 @@ var (
|
||||
|
||||
// IsListType returns true if the provided Object has a slice called Items.
|
||||
// TODO: Replace the code in this check with an interface comparison by
|
||||
// creating and enforcing that lists implement a list accessor.
|
||||
//
|
||||
// creating and enforcing that lists implement a list accessor.
|
||||
func IsListType(obj runtime.Object) bool {
|
||||
switch t := obj.(type) {
|
||||
case runtime.Unstructured:
|
||||
@ -97,7 +98,7 @@ func getItemsPtr(list runtime.Object) (interface{}, error) {
|
||||
return nil, errExpectFieldItems
|
||||
}
|
||||
switch items.Kind() {
|
||||
case reflect.Interface, reflect.Ptr:
|
||||
case reflect.Interface, reflect.Pointer:
|
||||
target := reflect.TypeOf(items.Interface()).Elem()
|
||||
if target.Kind() != reflect.Slice {
|
||||
return nil, errExpectSliceItems
|
||||
@ -130,7 +131,7 @@ func EachListItem(obj runtime.Object, fn func(runtime.Object) error) error {
|
||||
return nil
|
||||
}
|
||||
takeAddr := false
|
||||
if elemType := items.Type().Elem(); elemType.Kind() != reflect.Ptr && elemType.Kind() != reflect.Interface {
|
||||
if elemType := items.Type().Elem(); elemType.Kind() != reflect.Pointer && elemType.Kind() != reflect.Interface {
|
||||
if !items.Index(0).CanAddr() {
|
||||
return fmt.Errorf("unable to take address of items in %T for EachListItem", obj)
|
||||
}
|
||||
|
Reference in New Issue
Block a user