Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for SelectorFromValidatedSet (0.31 sec)

  1. staging/src/k8s.io/apimachinery/pkg/labels/labels.go

    // Note: this method copies the Set; if the Set is immutable, consider wrapping it with ValidatedSetSelector
    // instead, which does not copy.
    func (ls Set) AsSelectorPreValidated() Selector {
    	return SelectorFromValidatedSet(ls)
    }
    
    // FormatLabels converts label map into plain string
    func FormatLabels(labelMap map[string]string) string {
    	l := Set(labelMap).String()
    	if l == "" {
    		l = "<none>"
    	}
    	return l
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Nov 14 16:39:04 UTC 2022
    - 4.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/labels/selector.go

    // It does not perform any validation, which means the server will reject
    // the request if the Set contains invalid values.
    func SelectorFromSet(ls Set) Selector {
    	return SelectorFromValidatedSet(ls)
    }
    
    // ValidatedSelectorFromSet returns a Selector which will match exactly the given Set. A
    // nil and empty Sets are considered equivalent to Everything().
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Dec 18 04:27:38 UTC 2022
    - 31.8K bytes
    - Viewed (0)
  3. pkg/kube/krt/bench_test.go

    	c.services.AddEventHandler(controllers.FromEventHandler(func(e controllers.Event) {
    		o := e.Latest()
    		for _, pod := range c.pods.List(o.GetNamespace(), klabels.SelectorFromValidatedSet(o.(*v1.Service).Spec.Selector)) {
    			c.queue.AddObject(pod)
    		}
    	}))
    	c.handler = func(e krt.Event[Workload]) {
    		events <- fmt.Sprintf(e.Latest().Name, e.Event)
    	}
    	go c.queue.Run(stop)
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 09 19:55:53 UTC 2024
    - 7K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/labels/selector_test.go

    		"foo": "foo",
    		"bar": "bar",
    	}
    	matchee := Set(map[string]string{
    		"foo":   "foo",
    		"bar":   "bar",
    		"extra": "label",
    	})
    
    	for i := 0; i < b.N; i++ {
    		s := SelectorFromValidatedSet(set)
    		if s.Empty() {
    			b.Errorf("Unexpected selector")
    		}
    		if !s.Matches(matchee) {
    			b.Errorf("Unexpected match")
    		}
    	}
    }
    
    func BenchmarkSetSelector(b *testing.B) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Nov 14 16:39:04 UTC 2022
    - 29.9K bytes
    - Viewed (0)
Back to top