Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ByServiceSelector (0.24 sec)

  1. pilot/pkg/serviceregistry/util/workloadinstances/selector.go

    // limitations under the License.
    
    package workloadinstances
    
    import (
    	"istio.io/istio/pilot/pkg/model"
    	"istio.io/istio/pkg/config/labels"
    )
    
    // ByServiceSelector returns a predicate that matches workload instances
    // of a given service.
    func ByServiceSelector(namespace string, selector labels.Instance) func(*model.WorkloadInstance) bool {
    	return func(wi *model.WorkloadInstance) bool {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 07 04:26:56 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  2. pilot/pkg/serviceregistry/util/workloadinstances/index_test.go

    	index := NewIndex()
    
    	// test update
    	index.Insert(wi1)
    	index.Insert(wi2)
    	index.Insert(wi3)
    	index.Insert(wi4)
    
    	// test search by service selector
    	actual := FindAllInIndex(index, ByServiceSelector(selector.Namespace, labels.Instance{"app": "wle"}))
    	want := []*model.WorkloadInstance{wi1, wi2}
    
    	assert.Equal(t, len(want), len(actual))
    
    	got := map[string]*model.WorkloadInstance{}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 23 21:07:03 UTC 2024
    - 5K bytes
    - Viewed (0)
  3. pilot/pkg/serviceregistry/serviceentry/controller.go

    	serviceInstancesByConfig := map[configKey][]*model.ServiceInstance{}
    	// for service entry with labels
    	if currentServiceEntry.WorkloadSelector != nil {
    		selector := workloadinstances.ByServiceSelector(curr.Namespace, currentServiceEntry.WorkloadSelector.Labels)
    		workloadInstances := workloadinstances.FindAllInIndex(s.workloadInstances, selector)
    		for _, wi := range workloadInstances {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 29 15:31:09 UTC 2024
    - 36.8K bytes
    - Viewed (0)
Back to top