Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 131 for UpdateFunc (0.18 sec)

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

    	defer destroy()
    
    	obj := UnstructuredOrDie(`{"kind": "Pod"}`)
    
    	updateFunc := func(input runtime.Object, res storage.ResponseMeta) (output runtime.Object, ttl *uint64, err error) {
    		return input, nil, errors.New("UpdateFunction shouldn't be called")
    	}
    
    	err := s.GuaranteedUpdate(context.Background(), "key", obj, false, nil, updateFunc, true, nil)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 24 09:23:05 UTC 2023
    - 9.9K bytes
    - Viewed (0)
  2. pilot/pkg/status/manager.go

    		return &IstioGenerationProvider{result}
    	}
    	result := &Controller{
    		fn:      wrapper,
    		workers: m.workers,
    	}
    	return result
    }
    
    type UpdateFunc func(status any, context any) GenerationProvider
    
    type Controller struct {
    	fn      UpdateFunc
    	workers WorkerQueue
    }
    
    // EnqueueStatusUpdateResource informs the manager that this controller would like to
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 24 04:04:42 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/registry/generic/testing/tester.go

    	)
    }
    
    func (t *Tester) TestUpdate(valid runtime.Object, validUpdateFunc UpdateFunc, invalidUpdateFunc ...UpdateFunc) {
    	var invalidFuncs []resttest.UpdateFunc
    	for _, f := range invalidUpdateFunc {
    		invalidFuncs = append(invalidFuncs, resttest.UpdateFunc(f))
    	}
    	t.tester.TestUpdate(
    		valid,
    		t.createObject,
    		t.getObject,
    		resttest.UpdateFunc(validUpdateFunc),
    		invalidFuncs...,
    	)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 17 16:50:16 UTC 2019
    - 4.8K bytes
    - Viewed (0)
  4. pkg/kube/controllers/common.go

    	} else if e.AddFunc != nil {
    		e.AddFunc(Extract[T](obj))
    	}
    }
    
    func (e EventHandler[T]) OnUpdate(oldObj, newObj interface{}) {
    	if e.UpdateFunc != nil {
    		e.UpdateFunc(Extract[T](oldObj), Extract[T](newObj))
    	}
    }
    
    func (e EventHandler[T]) OnDelete(obj interface{}) {
    	if e.DeleteFunc != nil {
    		e.DeleteFunc(Extract[T](obj))
    	}
    }
    
    var _ cache.ResourceEventHandler = EventHandler[Object]{}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Apr 11 08:27:29 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  5. pkg/registry/core/event/storage/storage_test.go

    	test.TestUpdate(
    		// valid
    		validNewEvent(test.TestNamespace()),
    		// valid updateFunc
    		func(obj runtime.Object) runtime.Object {
    			object := obj.(*api.Event)
    			object.Series.Count = 100
    			return object
    		},
    		// invalid updateFunc
    		func(obj runtime.Object) runtime.Object {
    			object := obj.(*api.Event)
    			object.ReportingController = ""
    			return object
    		},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 01 14:50:28 UTC 2020
    - 3.4K bytes
    - Viewed (0)
  6. plugin/pkg/auth/authorizer/node/graph_populator.go

    		graph: graph,
    	}
    
    	podHandler, _ := pods.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
    		AddFunc:    g.addPod,
    		UpdateFunc: g.updatePod,
    		DeleteFunc: g.deletePod,
    	})
    
    	pvsHandler, _ := pvs.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
    		AddFunc:    g.addPV,
    		UpdateFunc: g.updatePV,
    		DeleteFunc: g.deletePV,
    	})
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 21:22:55 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  7. pkg/registry/batch/cronjob/storage/storage_test.go

    	schedule := "1 1 1 1 ?"
    	test.TestUpdate(
    		// valid
    		validNewCronJob(),
    		// updateFunc
    		func(obj runtime.Object) runtime.Object {
    			object := obj.(*batch.CronJob)
    			object.Spec.Schedule = schedule
    			return object
    		},
    		// invalid updateFunc
    		func(obj runtime.Object) runtime.Object {
    			object := obj.(*batch.CronJob)
    			object.Spec.Schedule = "* * *"
    			return object
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Aug 12 20:55:35 UTC 2019
    - 4.4K bytes
    - Viewed (0)
  8. pkg/registry/networking/networkpolicy/storage/storage_test.go

    	storage, server := newStorage(t)
    	defer server.Terminate(t)
    	defer storage.Store.DestroyFunc()
    	test := genericregistrytest.New(t, storage.Store)
    	test.TestUpdate(
    		// valid
    		validNetworkPolicy(),
    		// updateFunc
    		func(obj runtime.Object) runtime.Object {
    			object := obj.(*networking.NetworkPolicy)
    			object.Spec.Ingress = []networking.NetworkPolicyIngressRule{
    				{
    					From: []networking.NetworkPolicyPeer{
    						{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 18:19:25 UTC 2023
    - 5K bytes
    - Viewed (0)
  9. pkg/registry/apiserverinternal/storageversion/storage/storage_test.go

    	test.TestUpdate(
    		// valid
    		validStorageVersion(),
    		// updateFunc
    		func(obj runtime.Object) runtime.Object {
    			object := obj.(*apiserverinternal.StorageVersion)
    			update := &apiserverinternal.StorageVersion{
    				ObjectMeta: object.ObjectMeta,
    			}
    			return update
    		},
    		// invalid updateFunc
    		func(obj runtime.Object) runtime.Object {
    			object := obj.(*apiserverinternal.StorageVersion)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Sep 06 07:26:18 UTC 2021
    - 5.4K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/storage/util.go

    	"k8s.io/apimachinery/pkg/labels"
    	"k8s.io/apimachinery/pkg/runtime"
    )
    
    type SimpleUpdateFunc func(runtime.Object) (runtime.Object, error)
    
    // SimpleUpdateFunc converts SimpleUpdateFunc into UpdateFunc
    func SimpleUpdate(fn SimpleUpdateFunc) UpdateFunc {
    	return func(input runtime.Object, _ ResponseMeta) (runtime.Object, *uint64, error) {
    		out, err := fn(input)
    		return out, nil, err
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 18 08:05:06 UTC 2024
    - 4.6K bytes
    - Viewed (0)
Back to top