Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 59 for waitForCacheSync (0.19 sec)

  1. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/validating/plugin_test.go

    			wh.SetServiceResolver(webhooktesting.NewServiceResolver(*serverURL))
    			wh.SetExternalKubeClientSet(client)
    			wh.SetExternalKubeInformerFactory(informer)
    
    			informer.Start(stopCh)
    			informer.WaitForCacheSync(stopCh)
    
    			if err = wh.ValidateInitialization(); err != nil {
    				b.Errorf("%s: failed to validate initialization: %v", tt.Name, err)
    				return
    			}
    
    			attr := webhooktesting.NewAttribute(ns, nil, tt.IsDryRun)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 06:06:52 UTC 2024
    - 11.9K bytes
    - Viewed (0)
  2. pkg/kube/client.go

    		}
    		if !sleep.Until(stop, delay) {
    			return false
    		}
    	}
    }
    
    // WaitForCacheSync is a specialized version of the general WaitForCacheSync function which also
    // handles fake client syncing.
    // This is only required in cases where fake clients are used without RunAndWait.
    func (c *client) WaitForCacheSync(name string, stop <-chan struct{}, cacheSyncs ...cache.InformerSynced) bool {
    	if c.informerWatchesPending == nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Apr 25 14:44:17 UTC 2024
    - 39K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/mutating/plugin_test.go

    			wh.SetServiceResolver(webhooktesting.NewServiceResolver(*serverURL))
    			wh.SetExternalKubeClientSet(client)
    			wh.SetExternalKubeInformerFactory(informer)
    
    			informer.Start(stopCh)
    			informer.WaitForCacheSync(stopCh)
    
    			if err = wh.ValidateInitialization(); err != nil {
    				b.Errorf("failed to validate initialization: %v", err)
    				return
    			}
    
    			var attr admission.Attributes
    			if tt.IsCRD {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 06:06:52 UTC 2024
    - 11K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/internal/generic/controller_test.go

    	require.False(t, myController.HasSynced())
    
    	// Wait for all enqueued reconciliations
    	require.NoError(t, waitForReconcile(initialObject))
    
    	// Now it is safe to wait for it to Sync
    	require.True(t, cache.WaitForCacheSync(testContext.Done(), myController.HasSynced))
    
    	// Updated object
    	updatedObject := &unstructured.Unstructured{}
    	updatedObject.SetUnstructuredContent(map[string]interface{}{
    		"metadata": map[string]interface{}{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 12 18:58:24 UTC 2024
    - 16.1K bytes
    - Viewed (0)
  5. pkg/kubelet/volume_host.go

    	return kvh.csiDriverLister
    }
    
    func (kvh *kubeletVolumeHost) CSIDriversSynced() cache.InformerSynced {
    	return kvh.csiDriversSynced
    }
    
    // WaitForCacheSync is a helper function that waits for cache sync for CSIDriverLister
    func (kvh *kubeletVolumeHost) WaitForCacheSync() error {
    	if kvh.csiDriversSynced == nil {
    		klog.ErrorS(nil, "CsiDriversSynced not found on KubeletVolumeHost")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 18 11:00:37 UTC 2024
    - 10K bytes
    - Viewed (0)
  6. pkg/kubelet/clustertrustbundle/clustertrustbundle_manager_test.go

    	ctbInformer := informerFactory.Certificates().V1alpha1().ClusterTrustBundles()
    	ctbManager, _ := NewInformerManager(ctbInformer, 256, 5*time.Minute)
    
    	informerFactory.Start(ctx.Done())
    	if !cache.WaitForCacheSync(ctx.Done(), ctbInformer.Informer().HasSynced) {
    		t.Fatalf("Timed out waiting for informer to sync")
    	}
    
    	gotBundle, err := ctbManager.GetTrustAnchorsByName("ctb1", false)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 03 18:40:48 UTC 2023
    - 15.5K bytes
    - Viewed (0)
  7. security/pkg/server/ca/node_auth_test.go

    						NodeName:           p.node,
    					},
    				})
    			}
    			c := kube.NewFakeClient(pods...)
    			na := NewClusterNodeAuthorizer(c, tt.trustedAccounts)
    			c.RunAndWait(test.NewStop(t))
    			kube.WaitForCacheSync("test", test.NewStop(t), na.pods.HasSynced)
    
    			err := na.authenticateImpersonation(tt.caller, tt.requestedIdentityString)
    			if tt.wantErr == "" && err != nil {
    				t.Fatalf("wanted no error, got %v", err)
    			}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Feb 28 16:41:38 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  8. cni/pkg/repair/repair_test.go

    			assert.NoError(t, err)
    			t.Cleanup(func() {
    				assert.NoError(t, c.queue.WaitForClose(time.Second))
    			})
    			stop := test.NewStop(t)
    			tt.client.RunAndWait(stop)
    			go c.Run(stop)
    			kube.WaitForCacheSync("test", stop, c.queue.HasSynced)
    
    			assert.EventuallyEqual(t, func() map[string]string {
    				havePods := c.pods.List(metav1.NamespaceAll, klabels.Everything())
    				slices.SortBy(havePods, func(a *corev1.Pod) string {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 24 03:31:28 UTC 2023
    - 10.6K bytes
    - Viewed (0)
  9. pilot/pkg/config/kube/crdclient/client_test.go

    			}
    		}
    		clienttest.MakeCRDWithAnnotations(t, fake, s.GroupVersionResource(), annotations)
    	}
    	stop := test.NewStop(t)
    	config := New(fake, Option{})
    	go config.Run(stop)
    	fake.RunAndWait(stop)
    	kube.WaitForCacheSync("test", stop, config.HasSynced)
    	return config, fake
    }
    
    func createResource(t *testing.T, store model.ConfigStoreController, r resource.Schema, configMeta config.Meta) config.Spec {
    	pb, err := r.NewInstance()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 02:58:52 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  10. plugin/pkg/admission/security/podsecurity/admission_test.go

    	informerFactory := informers.NewSharedInformerFactory(c, 0)
    	p.SetExternalKubeInformerFactory(informerFactory)
    	stopCh := make(chan struct{})
    	defer close(stopCh)
    	informerFactory.Start(stopCh)
    	informerFactory.WaitForCacheSync(stopCh)
    
    	if err := p.ValidateInitialization(); err != nil {
    		b.Fatal(err)
    	}
    
    	corePod := &core.Pod{}
    	v1Pod := &corev1.Pod{}
    	data, err := ioutil.ReadFile("testdata/pod_restricted.yaml")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 15 01:29:47 UTC 2022
    - 10.7K bytes
    - Viewed (0)
Back to top