Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 232 for func (0.24 sec)

  1. cni/pkg/plugin/plugin_test.go

    		},
    	}
    
    	return fakePod, fakeNS
    }
    
    func (mrdir *mockInterceptRuleMgr) Program(podName, netns string, redirect *Redirect) error {
    	mrdir.lastRedirect = append(mrdir.lastRedirect, redirect)
    	return nil
    }
    
    // returns the test server URL and a dispose func for the test server
    func setupCNIEventClientWithMockServer(serverErr bool) (string, func() bool) {
    	cniAddServerCalled := false
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Sat Feb 10 00:31:55 GMT 2024
    - 17.5K bytes
    - Viewed (0)
  2. cni/pkg/iptables/iptables_test.go

    	"strings"
    	"testing"
    
    	testutil "istio.io/istio/pilot/test/util"
    	dep "istio.io/istio/tools/istio-iptables/pkg/dependencies"
    )
    
    func TestIptables(t *testing.T) {
    	cases := []struct {
    		name   string
    		config func(cfg *Config)
    	}{
    		{
    			"default",
    			func(cfg *Config) {
    				cfg.RedirectDNS = true
    			},
    		},
    	}
    	probeSNATipv4 := netip.MustParseAddr("169.254.7.127")
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Apr 30 22:24:38 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  3. cni/test/install_cni.go

      }
    }
    `
    )
    
    func getEnv(key, fallback string) string {
    	if value, ok := os.LookupEnv(key); ok {
    		return value
    	}
    	return fallback
    }
    
    func setEnv(key, value string, t *testing.T) {
    	t.Helper()
    	err := os.Setenv(key, value)
    	if err != nil {
    		t.Fatalf("Couldn't set environment variable, err: %v", err)
    	}
    }
    
    func mktemp(dir, prefix string, t *testing.T) string {
    	t.Helper()
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  4. cni/pkg/ipset/nldeps_mock.go

    type MockedIpsetDeps struct {
    	mock.Mock
    }
    
    func FakeNLDeps() *MockedIpsetDeps {
    	return &MockedIpsetDeps{}
    }
    
    func (m *MockedIpsetDeps) ipsetIPHashCreate(name string, v6 bool) error {
    	args := m.Called(name, v6)
    	return args.Error(0)
    }
    
    func (m *MockedIpsetDeps) destroySet(name string) error {
    	args := m.Called(name)
    	return args.Error(0)
    }
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Apr 30 22:24:38 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  5. cni/pkg/nodeagent/ztunnelserver.go

    		listener: l,
    		conns: &connMgr{
    			connectionSet: map[*ZtunnelConnection]struct{}{},
    		},
    		pods: pods,
    	}, nil
    }
    
    func (z *ztunnelServer) Close() error {
    	return z.listener.Close()
    }
    
    func (z *ztunnelServer) Run(ctx context.Context) {
    	context.AfterFunc(ctx, func() { _ = z.Close() })
    
    	for {
    		log.Debug("accepting conn")
    		conn, err := z.accept()
    		if err != nil {
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 12.4K bytes
    - Viewed (0)
  6. istioctl/pkg/completion/completion.go

    		if toComplete == "" || strings.HasPrefix(pod.Name, toComplete) {
    			podsName = append(podsName, pod.Name)
    		}
    	}
    
    	return podsName, nil
    }
    
    func ValidPodsNameArgs(ctx cli.Context) func(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
    	return func(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
    		if len(args) != 0 {
    			return nil, cobra.ShellCompDirectiveNoFileComp
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Sat Apr 13 05:23:38 GMT 2024
    - 4.9K bytes
    - Viewed (0)
  7. istioctl/pkg/dashboard/dashboard.go

    	}
    
    	return fmt.Errorf("failure running port forward process: %v", err)
    }
    
    func ClosePortForwarderOnInterrupt(fw kube.PortForwarder) {
    	go func() {
    		signals := make(chan os.Signal, 1)
    		signal.Notify(signals, os.Interrupt)
    		defer signal.Stop(signals)
    		<-signals
    		fw.Close()
    	}()
    }
    
    func openBrowser(url string, writer io.Writer, browser bool) {
    	var err error
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Mon Apr 15 01:29:35 GMT 2024
    - 20.5K bytes
    - Viewed (0)
  8. istioctl/pkg/proxyconfig/clusters.go

    )
    
    // TODO move to multicluster package; requires exposing some private funcs/vars in this package
    func ClustersCommand(ctx cli.Context) *cobra.Command {
    	var opts clioptions.ControlPlaneOptions
    	cmd := &cobra.Command{
    		Use:   "remote-clusters",
    		Short: "Lists the remote clusters each istiod instance is connected to.",
    		RunE: func(cmd *cobra.Command, args []string) error {
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Thu Jun 15 15:02:17 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  9. cni/pkg/nodeagent/net_test.go

    	set := ipset.IPSet{V4Name: "foo-v4", Prefix: "foo", Deps: fakeIPSetDeps}
    	netServer := newNetServer(ztunnelServer, podNsMap, iptablesConfigurator, NewPodNetnsProcFinder(fakeFs()), set)
    
    	netServer.netnsRunner = func(fdable NetnsFd, toRun func() error) error {
    		return toRun()
    	}
    	netServer.Start(ctx)
    	return netTestFixture{
    		netServer:            netServer,
    		podNsMap:             podNsMap,
    		ztunnelServer:        ztunnelServer,
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Apr 30 22:24:38 GMT 2024
    - 16.4K bytes
    - Viewed (0)
  10. cni/pkg/nodeagent/netns_other.go

    package nodeagent
    
    import "errors"
    
    func inodeForFd(n NetnsFd) (uint64, error) {
    	return 0, errors.New("not implemented")
    }
    
    func NetnsSet(n NetnsFd) error {
    	return errors.New("not implemented")
    }
    
    func OpenNetns(nspath string) (NetnsCloser, error) {
    	return nil, errors.New("not implemented")
    }
    
    // inspired by netns.Do() but with an existing fd.
    func NetnsDo(fdable NetnsFd, toRun func() error) error {
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Thu Mar 14 09:32:25 GMT 2024
    - 1K bytes
    - Viewed (0)
Back to top