Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for netbsd (0.19 sec)

  1. cni/pkg/nodeagent/netns_linux.go

    }
    
    func NetnsSet(n NetnsFd) error {
    	if err := unix.Setns(int(n.Fd()), unix.CLONE_NEWNET); err != nil {
    		return fmt.Errorf("Error switching to ns fd %v: %v", n.Fd(), err)
    	}
    	return nil
    }
    
    // inspired by netns.Do() but with an existing fd.
    func NetnsDo(fdable NetnsFd, toRun func() error) error {
    	containedCall := func() error {
    		threadNS, err := netns.GetCurrentNS()
    		if err != nil {
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Wed Jan 31 10:05:36 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  2. cni/pkg/repair/netns.go

    	return "/host/proc/" + strconv.Itoa(pid) + "/ns/net"
    }
    
    func runInHost[T any](f func() (T, error)) (T, error) {
    	var res T
    	ns, err := netns.GetNS(getPidNamespace(1))
    	if err != nil {
    		return res, fmt.Errorf("failed to get host network: %v", err)
    	}
    	err = ns.Do(func(ns netns.NetNS) error {
    		var err error
    		res, err = f()
    		return err
    	})
    	if err != nil {
    		return res, fmt.Errorf("in host network: %v", err)
    	}
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Wed Dec 20 22:14:13 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  3. 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 08 22:53:08 GMT 2024
    - Last Modified: Thu Mar 14 09:32:25 GMT 2024
    - 1K bytes
    - Viewed (0)
  4. cni/pkg/repair/repaircontroller.go

    	netns, err := runInHost(func() (string, error) { return getPodNetNs(pod) })
    	if err != nil {
    		m.With(resultLabel.Value(resultFail)).Increment()
    		return fmt.Errorf("get netns: %v", err)
    	}
    	log = log.WithLabels("netns", netns)
    
    	if err := redirectRunningPod(pod, netns); err != nil {
    		log.Errorf("failed to setup redirection: %v", err)
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Sat Feb 10 00:31:55 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  5. cni/pkg/nodeagent/net.go

    	// in that case, try finding the netns using procfs.
    	filter := map[types.UID]*corev1.Pod{
    		pod.UID: pod,
    	}
    	return s.scanProcForPodsAndCache(filter)
    }
    
    func (s *NetServer) getOrOpenNetns(pod *corev1.Pod, netNs string) (Netns, error) {
    	if netNs == "" {
    		return s.getNetns(pod)
    	}
    	return s.openNetns(pod, netNs)
    }
    
    func (s *NetServer) openNetns(pod *corev1.Pod, netNs string) (Netns, error) {
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Apr 30 22:24:38 GMT 2024
    - 12.2K bytes
    - Viewed (1)
  6. cni/README.md

        - on pod add, determines whether pod should have netns setup to redirect to Istio proxy. See [cmdAdd](#cmdadd-workflow) for detailed logic.
            - it connects to K8S using the kubeconfig and JWT token copied from install-cni to get Pod and Namespace. Since this is a short-running command, each invocation creates a new connection.
            - If so, calls `istio-iptables` with params to setup pod netns
            - If ambient, sets up the ambient logic.
    
    Plain Text
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Fri May 03 19:29:42 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  7. cni/pkg/plugin/sidecar_iptables_unspecified.go

    var ErrNotImplemented = errors.New("not implemented")
    
    // Program defines a method which programs iptables based on the parameters
    // provided in Redirect.
    func (ipt *iptables) Program(podName, netns string, rdrct *Redirect) error {
    	return ErrNotImplemented
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  8. cni/pkg/nodeagent/pod_cache.go

    	if existing := p.currentPodCache[uid]; existing.Netns != nil {
    		if existing.Netns.Inode() == workload.Netns.Inode() {
    			workload.Netns.Close()
    			// Replace the workload, but keep the old Netns
    			p.currentPodCache[uid] = WorkloadInfo{
    				Workload: workload.Workload,
    				Netns:    existing.Netns,
    			}
    			// already in cache
    			return existing.Netns
    		}
    		log.Debug("netns inode mismatch, using the new one")
    	}
    
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 4.5K bytes
    - Viewed (0)
  9. cni/pkg/plugin/sidecar_iptables_linux.go

    	cfg.DualStack = rdrct.dualStack
    	if err := cfg.FillConfigFromEnvironment(); err != nil {
    		return err
    	}
    
    	netNs, err := getNs(netns)
    	if err != nil {
    		err = fmt.Errorf("failed to open netns %q: %s", netns, err)
    		return err
    	}
    	defer netNs.Close()
    
    	return netNs.Do(func(_ ns.NetNS) error {
    		log.Infof("============= Start iptables configuration for %v =============", podName)
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Thu Apr 18 17:36:41 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  10. cni/pkg/nodeagent/server.go

    	ConstructInitialSnapshot(ambientPods []*corev1.Pod) error
    	Start(ctx context.Context)
    
    	//	IsPodInMesh(ctx context.Context, pod *metav1.ObjectMeta, netNs string) (bool, error)
    	AddPodToMesh(ctx context.Context, pod *corev1.Pod, podIPs []netip.Addr, netNs string) error
    	RemovePodFromMesh(ctx context.Context, pod *corev1.Pod) error
    	DelPodFromMesh(ctx context.Context, pod *corev1.Pod) error
    
    	Stop()
    }
    
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Apr 30 22:24:38 GMT 2024
    - 7.2K bytes
    - Viewed (0)
Back to top