Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for IgnoreNotFound (0.55 sec)

  1. staging/src/k8s.io/apiserver/pkg/registry/generic/registry/dryrun.go

    			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
    		}
    		err = preconditions.Check(key, current)
    		if err != nil {
    			return err
    		}
    		rev, err := s.Versioner().ObjectResourceVersion(current)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 02 20:40:48 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go

    	return func() (*objState, error) {
    		startTime := time.Now()
    		getResp, err := s.client.KV.Get(ctx, key)
    		metrics.RecordEtcdRequest("get", s.groupResourceString, err, startTime)
    		if err != nil {
    			return nil, err
    		}
    		return s.getState(ctx, getResp, key, v, ignoreNotFound)
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 11:56:42 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/storage/interfaces.go

    }
    
    // GetOptions provides the options that may be provided for storage get operations.
    type GetOptions struct {
    	// IgnoreNotFound determines what is returned if the requested object is not found. If
    	// true, a zero object is returned. If false, an error is returned.
    	IgnoreNotFound bool
    	// ResourceVersion provides a resource version constraint to apply to the get operation
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 29 07:53:48 UTC 2024
    - 14.8K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/storage/testing/store_tests.go

    		key                 string
    		ignoreNotFound      bool
    		precondition        *storage.Preconditions
    		expectNotFoundErr   bool
    		expectInvalidObjErr bool
    		expectNoUpdate      bool
    		transformStale      bool
    		hasSelfLink         bool
    	}{{
    		name:                "non-existing key, ignoreNotFound=false",
    		key:                 "/non-existing",
    		ignoreNotFound:      false,
    		precondition:        nil,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 11 12:45:33 UTC 2024
    - 91.4K bytes
    - Viewed (0)
  5. pkg/kube/controllers/common.go

    			return empty
    		}
    	}
    	return o
    }
    
    func ExtractObject(obj any) Object {
    	return Extract[Object](obj)
    }
    
    // IgnoreNotFound returns nil on NotFound errors.
    // All other values that are not NotFound errors or nil are returned unmodified.
    func IgnoreNotFound(err error) error {
    	if kerrors.IsNotFound(err) {
    		return nil
    	}
    	return err
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Apr 11 08:27:29 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go

    	lastGraceful := int64(0)
    	var pendingFinalizers bool
    	out = e.NewFunc()
    	err = e.Storage.GuaranteedUpdate(
    		ctx,
    		key,
    		out,
    		false, /* ignoreNotFound */
    		&preconditions,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 19 23:22:44 UTC 2024
    - 60.8K bytes
    - Viewed (0)
  7. pkg/registry/core/service/allocator/storage/storage.go

    func (e *Etcd) Get() (*api.RangeAllocation, error) {
    	existing := &api.RangeAllocation{}
    	if err := e.storage.Get(context.TODO(), e.baseKey, storage.GetOptions{IgnoreNotFound: true}, existing); err != nil {
    		return nil, storeerr.InterpretGetError(err, e.resource, "")
    	}
    	return existing, nil
    }
    
    // CreateOrUpdate attempts to update the current etcd state with the provided
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 09:23:05 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go

    		// current object.
    		currObj := elem.(*storeElement).Object.DeepCopyObject()
    		return c.storage.GuaranteedUpdate(ctx, key, destination, ignoreNotFound, preconditions, tryUpdate, currObj)
    	}
    	// If we couldn't get the object, fallback to no-suggestion.
    	return c.storage.GuaranteedUpdate(ctx, key, destination, ignoreNotFound, preconditions, tryUpdate, nil)
    }
    
    // Count implements storage.Interface.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 10:12:02 UTC 2024
    - 51.8K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher_whitebox_test.go

    	err = cacher.Get(context.TODO(), "pods/ns/pod-0", storage.GetOptions{
    		IgnoreNotFound:  true,
    		ResourceVersion: "0",
    	}, result)
    	if err != nil {
    		t.Errorf("Get with RV=0 should be served from cache: %v", err)
    	}
    
    	err = cacher.Get(context.TODO(), "pods/ns/pod-0", storage.GetOptions{
    		IgnoreNotFound:  true,
    		ResourceVersion: "",
    	}, result)
    	if err != errDummy {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 10:12:02 UTC 2024
    - 82.9K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store_test.go

    func (s *staleGuaranteedUpdateStorage) GuaranteedUpdate(
    	ctx context.Context, key string, destination runtime.Object, ignoreNotFound bool,
    	preconditions *storage.Preconditions, tryUpdate storage.UpdateFunc, _ runtime.Object) error {
    	return s.Interface.GuaranteedUpdate(ctx, key, destination, ignoreNotFound, preconditions, tryUpdate, s.cachedObj)
    }
    
    func TestDeleteWithCachedObject(t *testing.T) {
    	podName := "foo"
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 12 10:12:02 UTC 2024
    - 101.8K bytes
    - Viewed (0)
Back to top