Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for NewFakeClient (0.12 sec)

  1. cni/pkg/nodeagent/informers_test.go

    		},
    		Spec: corev1.PodSpec{
    			NodeName: NodeName,
    		},
    		Status: corev1.PodStatus{
    			PodIP: "11.1.1.12",
    		},
    	}
    	ns := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "test"}}
    
    	client := kube.NewFakeClient(ns, pod)
    
    	// We are expecting at most 1 calls to the mock, wait for them
    	wg, waitForMockCalls := NewWaitForNCalls(t, 1)
    	fs := &fakeServer{testWG: wg}
    
    	fs.On("AddPodToMesh",
    		ctx,
    		mock.IsType(pod),
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Oct 09 16:05:45 UTC 2024
    - 22.1K bytes
    - Viewed (0)
  2. cni/pkg/nodeagent/cni-watcher_test.go

    		Spec: corev1.PodSpec{
    			NodeName: NodeName,
    		},
    		Status: corev1.PodStatus{
    			PodIP: fakePodIP,
    		},
    	}
    	ns := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "funkyns"}}
    
    	client := kube.NewFakeClient(ns, pod)
    
    	// We are expecting at most 1 calls to the mock, wait for them
    	wg, waitForMockCalls := NewWaitForNCalls(t, 1)
    	fs := &fakeServer{testWG: wg}
    
    	fs.On("AddPodToMesh",
    		ctx,
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Oct 09 16:05:45 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  3. istioctl/pkg/precheck/precheck_test.go

    			if c.expectedError != nil {
    				assert.Error(t, err)
    			} else {
    				assert.NoError(t, err)
    			}
    		})
    	}
    }
    
    func Test_checkTracing(t *testing.T) {
    	cli := kube.NewFakeClient()
    	messages := diag.Messages{}
    
    	zipkinSvc := &corev1.Service{
    		ObjectMeta: metav1.ObjectMeta{
    			Name:      "zipkin",
    			Namespace: "istio-system",
    		},
    	}
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Tue Jul 09 12:01:22 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  4. istioctl/pkg/install/k8sversion/version_test.go

    			isValid: true,
    		},
    	}
    
    	var outBuf bytes.Buffer
    	var errBuf bytes.Buffer
    
    	for i, c := range cases {
    		t.Run(fmt.Sprintf("case %d %s", i, c.version), func(t *testing.T) {
    			k8sClient := kube.NewFakeClient()
    			k8sClient.Kube().Discovery().(*fakediscovery.FakeDiscovery).FakedServerVersion = c.version
    
    			logger := clog.NewConsoleLogger(&outBuf, &errBuf, nil)
    			IsK8VersionSupported(k8sClient, logger)
    
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Oct 30 21:50:50 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  5. istioctl/pkg/tag/generate_test.go

    		},
    	}
    	scheme := runtime.NewScheme()
    	codecFactory := serializer.NewCodecFactory(scheme)
    	deserializer := codecFactory.UniversalDeserializer()
    
    	fail := admitv1.Fail
    	fakeClient := kube.NewFakeClient(&admitv1.ValidatingWebhookConfiguration{
    		TypeMeta: metav1.TypeMeta{},
    		ObjectMeta: metav1.ObjectMeta{
    			Name: "istiod-default-validator",
    		},
    		Webhooks: []admitv1.ValidatingWebhook{
    			{
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Oct 09 16:05:45 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  6. istioctl/pkg/tag/tag_test.go

    			error:         "cannot create revision tag \"revision\"",
    		},
    	}
    
    	for _, tc := range tcs {
    		t.Run(tc.name, func(t *testing.T) {
    			var out bytes.Buffer
    
    			client := kube.NewFakeClient(tc.webhookBefore)
    			skipConfirmation = true
    			err := setTag(context.Background(), client, tc.tag, tc.revision, "istio-system", false, &out, nil)
    			if tc.error == "" && err != nil {
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Oct 09 16:05:45 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  7. istioctl/pkg/injector/injector-list_test.go

    		}),
    		createNamespace("no-ambient", map[string]string{
    			label.IoIstioDataplaneMode.Name: constants.DataplaneModeAmbient,
    			"istio-injection":               "enabled",
    		}),
    	}
    
    	client := kube.NewFakeClient(nss...)
    	expected := sets.New[string]("default", "no-ambient")
    	actual, err := getNamespaces(context.TODO(), client, "istio-system")
    	assert.NoError(t, err)
    	for _, ns := range actual {
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Oct 09 16:05:45 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  8. cni/pkg/plugin/plugin_test.go

    	conf, err := parseConfig(args.StdinData)
    	if err != nil {
    		t.Fatalf("config parse failed with error: %v", err)
    	}
    
    	// Create a kube client
    	client := kube.NewFakeClient(objects...)
    
    	mockRedir := &mockInterceptRuleMgr{}
    	err = doAddRun(args, conf, client.Kube(), mockRedir)
    	if err == nil {
    		t.Fatal("expected to fail, but did not!")
    	}
    
    	return mockRedir
    }
    
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Oct 09 16:05:45 UTC 2024
    - 17.3K bytes
    - Viewed (0)
  9. istioctl/pkg/cli/context.go

    	if _, ok := f.clients[rev]; !ok {
    		var cliclient kube.CLIClient
    		if f.version != "" {
    			cliclient = kube.NewFakeClientWithVersion(f.version, f.objects...)
    		} else {
    			cliclient = kube.NewFakeClient(f.objects...)
    		}
    		if rev != "" {
    			kube.SetRevisionForTest(cliclient, rev)
    		}
    		c := MockClient{
    			CLIClient: cliclient,
    			Results:   f.results,
    		}
    		f.clients[rev] = c
    	}
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Oct 23 19:31:32 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  10. cni/pkg/plugin/plugin_dryrun_test.go

    	conf, err := parseConfig(args.StdinData)
    	if err != nil {
    		t.Fatalf("config parse failed with error: %v", err)
    	}
    
    	// Create a kube client
    	client := kube.NewFakeClient(objects...)
    
    	err = doAddRun(args, conf, client.Kube(), IptablesInterceptRuleMgr())
    	if err != nil {
    		t.Fatalf("failed with error: %v", err)
    	}
    }
    
    func buildFakeDryRunPod() *corev1.Pod {
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Tue Aug 27 16:44:45 UTC 2024
    - 8.5K bytes
    - Viewed (0)
Back to top