Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for GuaranteedUpdate (0.21 sec)

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

    }
    
    func (s *DryRunnableStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error {
    	return s.Storage.GetList(ctx, key, opts, listObj)
    }
    
    func (s *DryRunnableStorage) GuaranteedUpdate(
    	ctx context.Context, key string, destination runtime.Object, ignoreNotFound bool,
    	preconditions *storage.Preconditions, tryUpdate storage.UpdateFunc, dryRun bool, cachedExistingObject runtime.Object) error {
    	if dryRun {
    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/registry/generic/registry/dryrun_test.go

    	}
    	wrongID := types.UID("wrong-uid")
    	myID := types.UID("my-uid")
    	err = s.GuaranteedUpdate(context.Background(), "key", obj, false, &storage.Preconditions{UID: &wrongID}, updateFunc, true, nil)
    	if e, ok := err.(*storage.StorageError); !ok || e.Code != storage.ErrCodeInvalidObj {
    		t.Errorf("Expected invalid object, error: %v", err)
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 09:23:05 UTC 2023
    - 9.9K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/storage/testing/watcher_tests.go

    			badOut := &example.Pod{}
    			err = store.GuaranteedUpdate(ctx, badKey, badOut, true, nil, storage.SimpleUpdate(
    				func(runtime.Object) (runtime.Object, error) {
    					obj := basePod.DeepCopy()
    					obj.Namespace = fmt.Sprintf("%s-bad", tt.namespace)
    					return obj, nil
    				}), nil)
    			if err != nil {
    				t.Fatalf("GuaranteedUpdate of bad pod failed: %v", err)
    			}
    
    			var prevObj *example.Pod
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 63.8K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/storage/testing/store_tests.go

    		return input, nil, nil
    	}
    	// GuaranteedUpdate without suggestion should return an error
    	if err := store.GuaranteedUpdate(ctx, preset[1].key, &example.Pod{}, false, nil, updateFunc, nil); !storage.IsInternalError(err) {
    		t.Errorf("Unexpected error: %v", err)
    	}
    	// GuaranteedUpdate with suggestion should return an error if we don't change the object
    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. staging/src/k8s.io/apiserver/pkg/storage/interfaces.go

    type MatchValue struct {
    	IndexName string
    	Value     string
    }
    
    // Pass an UpdateFunc to Interface.GuaranteedUpdate to make an update
    // that is guaranteed to succeed.
    // See the comment for GuaranteedUpdate for more details.
    type UpdateFunc func(input runtime.Object, res ResponseMeta) (output runtime.Object, ttl *uint64, err error)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 29 07:53:48 UTC 2024
    - 14.8K bytes
    - Viewed (0)
  6. pkg/registry/core/service/allocator/storage/storage.go

    	defer e.lock.Unlock()
    	e.alloc.ForEach(fn)
    }
    
    // tryUpdate performs a read-update to persist the latest snapshot state of allocation.
    func (e *Etcd) tryUpdate(fn func() error) error {
    	err := e.storage.GuaranteedUpdate(context.TODO(), e.baseKey, &api.RangeAllocation{}, true, nil,
    		storage.SimpleUpdate(func(input runtime.Object) (output runtime.Object, err error) {
    			existing := input.(*api.RangeAllocation)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 09:23:05 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/reconcilers/peer_endpoint_lease.go

    	// note: this means that this lease doesn't enforce mutual exclusion of ip/port usage between apiserver.
    	key := path.Join(r.serverLeases.baseKey, serverId)
    	return r.serverLeases.storage.GuaranteedUpdate(apirequest.NewDefaultContext(), key, &corev1.Endpoints{}, true, nil, func(input kruntime.Object, respMeta storage.ResponseMeta) (kruntime.Object, *uint64, error) {
    		existing := input.(*corev1.Endpoints)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 09:23:05 UTC 2023
    - 12.3K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go

    		if err != nil {
    			recordDecodeError(s.groupResourceString, key)
    			return err
    		}
    		return nil
    	}
    }
    
    // GuaranteedUpdate implements storage.Interface.GuaranteedUpdate.
    func (s *store) GuaranteedUpdate(
    	ctx context.Context, key string, destination runtime.Object, ignoreNotFound bool,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 11:56:42 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  9. pkg/controlplane/reconcilers/lease.go

    // UpdateLease resets the TTL on a master IP in storage
    // UpdateLease will create a new key if it doesn't exist.
    func (s *storageLeases) UpdateLease(ip string) error {
    	key := path.Join(s.baseKey, ip)
    	return s.storage.GuaranteedUpdate(apirequest.NewDefaultContext(), key, &corev1.Endpoints{}, true, nil, func(input kruntime.Object, respMeta storage.ResponseMeta) (kruntime.Object, *uint64, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 09:23:05 UTC 2023
    - 11.3K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go

    			return nil, false, err
    		}
    
    		preconditions := storage.Preconditions{UID: options.Preconditions.UID, ResourceVersion: options.Preconditions.ResourceVersion}
    
    		out := r.Store.NewFunc()
    		err = r.Store.Storage.GuaranteedUpdate(
    			ctx, key, out, false, &preconditions,
    			storage.SimpleUpdate(func(existing runtime.Object) (runtime.Object, error) {
    				existingCRD, ok := existing.(*apiextensions.CustomResourceDefinition)
    				if !ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 18 09:21:19 UTC 2022
    - 8K bytes
    - Viewed (0)
Back to top