- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for NewFakeClient (0.14 sec)
-
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
istioctl/pkg/multicluster/remote_secret_test.go
if c.updatedTokenSecret != nil { // fetching should give a different result than the token secret we pass in obj = []runtime.Object{c.updatedTokenSecret} } client := kube.NewFakeClient(obj...) got, err := createRemoteSecretFromTokenAndServer(client, c.haveTokenSecret, c.clusterName, c.server, secName) if c.wantErrStr != "" { if err == nil {
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Thu Oct 24 17:36:49 UTC 2024 - 20.7K bytes - Viewed (0)