Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ByServiceSelector (0.18 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)
Back to top