Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for NewEmptyInstance (0.38 sec)

  1. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured_list.go

    			return err
    		}
    	}
    	return nil
    }
    
    // NewEmptyInstance returns a new instance of the concrete type containing only kind/apiVersion and no other data.
    // This should be called instead of reflect.New() for unstructured types because the go type alone does not preserve kind/apiVersion info.
    func (u *UnstructuredList) NewEmptyInstance() runtime.Unstructured {
    	out := new(UnstructuredList)
    	if u != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun May 28 04:46:35 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/registry/generic/registry/dryrun.go

    		if err != nil {
    			return fmt.Errorf("unable to convert output object to pointer: %v", err)
    		}
    		if u, ok := v.Addr().Interface().(runtime.Unstructured); ok {
    			current = u.NewEmptyInstance()
    		} else {
    			current = reflect.New(v.Type()).Interface().(runtime.Object)
    		}
    
    		err = s.Storage.Get(ctx, key, storage.GetOptions{IgnoreNotFound: ignoreNotFound}, current)
    		if err != nil {
    			return err
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 02 20:40:48 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go

    	_, _, err := UnstructuredJSONScheme.Decode(b, nil, u)
    	return err
    }
    
    // NewEmptyInstance returns a new instance of the concrete type containing only kind/apiVersion and no other data.
    // This should be called instead of reflect.New() for unstructured types because the go type alone does not preserve kind/apiVersion info.
    func (in *Unstructured) NewEmptyInstance() runtime.Unstructured {
    	out := new(Unstructured)
    	if in != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun May 28 03:26:35 UTC 2023
    - 13.7K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/runtime/interfaces.go

    // to JSON allowed.
    type Unstructured interface {
    	Object
    	// NewEmptyInstance returns a new instance of the concrete type containing only kind/apiVersion and no other data.
    	// This should be called instead of reflect.New() for unstructured types because the go type alone does not preserve kind/apiVersion info.
    	NewEmptyInstance() Unstructured
    	// UnstructuredContent returns a non-nil map with this object's contents. Values may be
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun May 28 03:26:35 UTC 2023
    - 19K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/runtime/testing/types.go

    	// EachListItem has allocated a new Object for the user, we can use it directly.
    	return obj.EachListItem(fn)
    }
    
    func (obj *Unstructured) NewEmptyInstance() runtime.Unstructured {
    	out := new(Unstructured)
    	if obj != nil {
    		out.SetGroupVersionKind(obj.GroupVersionKind())
    	}
    	return out
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun May 28 03:26:35 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go

    	state := &objState{
    		meta: &storage.ResponseMeta{},
    	}
    
    	if u, ok := v.Addr().Interface().(runtime.Unstructured); ok {
    		state.obj = u.NewEmptyInstance()
    	} else {
    		state.obj = reflect.New(v.Type()).Interface().(runtime.Object)
    	}
    
    	if len(getResp.Kvs) == 0 {
    		if !ignoreNotFound {
    			return nil, storage.NewKeyNotFoundError(key, 0)
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 11:56:42 UTC 2024
    - 35.2K bytes
    - Viewed (0)
Back to top