Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for podToWorkload (0.26 sec)

  1. cni/pkg/nodeagent/pod_cache_test.go

    	ns := newFakeNsInode(inc(), 1)
    	wl := WorkloadInfo{
    		Workload: podToWorkload(pod),
    		Netns:    ns,
    	}
    	netns1 := p.UpsertPodCacheWithNetns(string(pod.UID), wl)
    	if !reflect.DeepEqual(netns1, ns) {
    		t.Fatalf("Expected the same Netns for the same uid, got %v and %v", netns1, ns)
    	}
    
    	ns2 := newFakeNsInode(inc(), 1)
    	wl2 := WorkloadInfo{
    		Workload: podToWorkload(pod),
    		Netns:    ns2,
    	}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  2. cni/pkg/nodeagent/pod_cache.go

    	}
    }
    
    func (p *podNetnsCache) UpsertPodCache(pod *corev1.Pod, nspath string) (Netns, error) {
    	newnetns, err := p.openNetns(nspath)
    	if err != nil {
    		return nil, err
    	}
    	wl := WorkloadInfo{
    		Workload: podToWorkload(pod),
    		Netns:    newnetns,
    	}
    	return p.UpsertPodCacheWithNetns(string(pod.UID), wl), nil
    }
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 4.5K bytes
    - Viewed (0)
  3. cni/pkg/nodeagent/ztunnelserver.go

    	for conn := range z.conns.connectionSet {
    		_, err := conn.send(ctx, data, nil)
    		if err != nil {
    			delErr = append(delErr, err)
    		}
    	}
    	return errors.Join(delErr...)
    }
    
    func podToWorkload(pod *v1.Pod) *zdsapi.WorkloadInfo {
    	namespace := pod.ObjectMeta.Namespace
    	name := pod.ObjectMeta.Name
    	svcAccount := pod.Spec.ServiceAccountName
    	trustDomain := spiffe.GetTrustDomain()
    	return &zdsapi.WorkloadInfo{
    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)
  4. cni/pkg/nodeagent/net_test.go

    	}
    
    	// this is usually called after add. so manually add the pod uid for now
    	fakens := newFakeNs(123)
    	closed := fakens.closed
    	workload := WorkloadInfo{
    		Workload: podToWorkload(pod),
    		Netns:    fakens,
    	}
    	fixture.podNsMap.UpsertPodCacheWithNetns(string(pod.UID), workload)
    	err := netServer.RemovePodFromMesh(ctx, pod)
    	assert.NoError(t, err)
    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)
  5. cni/pkg/nodeagent/ztunnelserver_test.go

    	ztunClient *net.UnixConn
    	ztunServer *ztunnelServer
    	uid        string
    } {
    	pods := &fakePodCache{}
    
    	pod, ns := podAndNetns()
    	workload := WorkloadInfo{
    		Workload: podToWorkload(pod),
    		Netns:    ns,
    	}
    	pods.pods = map[string]WorkloadInfo{
    		string(pod.UID): workload,
    	}
    	ret := connectWithPods(ctx, pods)
    
    	return struct {
    		ztunClient *net.UnixConn
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  6. cni/pkg/nodeagent/podcgroupns.go

    		}
    		if res == nil {
    			continue
    		}
    		pod := pods[res.uid]
    		netns := &NetnsWithFd{
    			netns: res.netns,
    			fd:    res.netnsfd,
    			inode: res.inode,
    		}
    		workload := WorkloadInfo{
    			Workload: podToWorkload(pod),
    			Netns:    netns,
    		}
    		podUIDNetns[string(res.uid)] = workload
    
    	}
    	return podUIDNetns, nil
    }
    
    type PodNetnsEntry struct {
    	uid     types.UID
    	netns   fs.File
    	netnsfd uintptr
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 11K bytes
    - Viewed (0)
Back to top