Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 58 for fakeclient (0.4 sec)

  1. pkg/controller/statefulset/stateful_pod_control_test.go

    	set := newStatefulSet(3)
    	pod := newStatefulSetPod(set, 0)
    	fakeClient := &fake.Clientset{}
    	claimIndexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
    	claimLister := corelisters.NewPersistentVolumeClaimLister(claimIndexer)
    	control := NewStatefulPodControl(fakeClient, nil, claimLister, recorder)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 05 19:06:41 UTC 2024
    - 35.5K bytes
    - Viewed (0)
  2. pilot/pkg/leaderelection/k8sleaderelection/leaderelection_test.go

    				{
    					verb: "get",
    					reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) {
    						return true, nil, errors.NewNotFound(action.(fakeclient.GetAction).GetResource().GroupResource(), action.(fakeclient.GetAction).GetName())
    					},
    				},
    				{
    					verb: "create",
    					reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jan 23 16:39:43 UTC 2023
    - 42.5K bytes
    - Viewed (0)
  3. pkg/kubelet/util/manager/watch_based_manager_test.go

    	"github.com/stretchr/testify/assert"
    )
    
    func listSecret(fakeClient clientset.Interface) listObjectFunc {
    	return func(namespace string, opts metav1.ListOptions) (runtime.Object, error) {
    		return fakeClient.CoreV1().Secrets(namespace).List(context.TODO(), opts)
    	}
    }
    
    func watchSecret(fakeClient clientset.Interface) watchObjectFunc {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 09 10:05:43 UTC 2023
    - 17.2K bytes
    - Viewed (0)
  4. pkg/volume/csi/csi_attacher_test.go

    			shouldFail:           true,
    		},
    	}
    
    	for i, tc := range testCases {
    		t.Run(tc.name, func(t *testing.T) {
    			fakeClient := fakeclient.NewSimpleClientset()
    			plug, tmpDir := newTestPlugin(t, fakeClient)
    			defer os.RemoveAll(tmpDir)
    
    			fakeWatcher := watch.NewRaceFreeFake()
    			fakeClient.Fake.PrependWatchReactor("volumeattachments", core.DefaultWatchReactor(fakeWatcher, nil))
    
    			attacher, err := plug.NewAttacher()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 18 12:23:16 UTC 2024
    - 58.1K bytes
    - Viewed (0)
  5. pkg/controlplane/reconcilers/instancecount_test.go

    		},
    	}
    	for _, test := range reconcileTests {
    		t.Run(test.testName, func(t *testing.T) {
    			fakeClient := fake.NewSimpleClientset(test.initialState...)
    			epAdapter := NewEndpointsAdapter(fakeClient.CoreV1(), fakeClient.DiscoveryV1())
    			reconciler := NewMasterCountEndpointReconciler(test.additionalMasters+1, epAdapter)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 27 12:46:24 UTC 2022
    - 14K bytes
    - Viewed (0)
  6. pkg/controller/statefulset/stateful_set_status_updater_test.go

    )
    
    func TestStatefulSetUpdaterUpdatesSetStatus(t *testing.T) {
    	set := newStatefulSet(3)
    	status := apps.StatefulSetStatus{ObservedGeneration: 1, Replicas: 2}
    	fakeClient := &fake.Clientset{}
    	updater := NewRealStatefulSetStatusUpdater(fakeClient, nil)
    	fakeClient.AddReactor("update", "statefulsets", func(action core.Action) (bool, runtime.Object, error) {
    		update := action.(core.UpdateAction)
    		return true, update.GetObject(), nil
    	})
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 13 15:37:10 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  7. pkg/kubelet/util/manager/cache_based_manager_test.go

    	store.Get("ns1", "s20")
    	store.Get("ns1", "s3")
    	actions = fakeClient.Actions()
    	assert.Equal(t, 3, len(actions), "unexpected actions: %#v", actions)
    	fakeClient.ClearActions()
    }
    
    func TestRegisterIdempotence(t *testing.T) {
    	fakeClient := &fake.Clientset{}
    	fakeClock := testingclock.NewFakeClock(time.Now())
    	store := newSecretStore(fakeClient, fakeClock, noObjectTTL, time.Minute)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 06:25:43 UTC 2024
    - 19.6K bytes
    - Viewed (0)
  8. pkg/controller/ttl/ttl_controller_test.go

    		},
    	}
    
    	for i, testCase := range testCases {
    		fakeClient := &fake.Clientset{}
    		ttlController := &Controller{
    			kubeClient: fakeClient,
    		}
    		err := ttlController.patchNodeWithAnnotation(context.TODO(), testCase.node, v1.ObjectTTLAnnotationKey, testCase.ttlSeconds)
    		if err != nil {
    			t.Errorf("%d: unexpected error: %v", i, err)
    			continue
    		}
    		actions := fakeClient.Actions()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  9. pkg/registry/core/service/ipallocator/controller/repair_test.go

    	r.updated = alloc
    	return r.updateErr
    }
    
    func TestRepair(t *testing.T) {
    	fakeClient := fake.NewSimpleClientset()
    	ipregistry := &mockRangeRegistry{
    		item: &api.RangeAllocation{Range: "192.168.1.0/24"},
    	}
    	_, cidr, _ := netutils.ParseCIDRSloppy(ipregistry.item.Range)
    	r := NewRepair(0, fakeClient.CoreV1(), fakeClient.EventsV1(), cidr, ipregistry, nil, nil)
    
    	if err := r.runOnce(); err != nil {
    		t.Fatal(err)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Sep 30 15:46:06 UTC 2023
    - 21.1K bytes
    - Viewed (0)
  10. pkg/controller/clusterroleaggregation/clusterroleaggregation_controller_test.go

    				for _, obj := range test.startingClusterRoles {
    					objs = append(objs, obj)
    					indexer.Add(obj)
    				}
    				fakeClient := fakeclient.NewSimpleClientset(objs...)
    
    				// The default reactor doesn't support apply, so we need our own (trivial) reactor
    				fakeClient.PrependReactor("patch", "clusterroles", func(action clienttesting.Action) (handled bool, ret runtime.Object, err error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:12 UTC 2023
    - 9K bytes
    - Viewed (0)
Back to top