mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 14:11:14 +00:00
Rename [label] query to selector
This commit is contained in:
@@ -30,15 +30,15 @@ type Labels interface {
|
||||
type Set map[string]string
|
||||
|
||||
// All labels listed as a human readable string. Conveniently, exactly the format
|
||||
// that ParseQuery takes.
|
||||
// that ParseSelector takes.
|
||||
func (ls Set) String() string {
|
||||
query := make([]string, 0, len(ls))
|
||||
selector := make([]string, 0, len(ls))
|
||||
for key, value := range ls {
|
||||
query = append(query, key+"="+value)
|
||||
selector = append(selector, key+"="+value)
|
||||
}
|
||||
// Sort for determinism.
|
||||
sort.StringSlice(query).Sort()
|
||||
return strings.Join(query, ",")
|
||||
sort.StringSlice(selector).Sort()
|
||||
return strings.Join(selector, ",")
|
||||
}
|
||||
|
||||
// Implement Labels interface.
|
||||
@@ -46,7 +46,7 @@ func (ls Set) Get(label string) string {
|
||||
return ls[label]
|
||||
}
|
||||
|
||||
// Convenience function: convert these labels to a query.
|
||||
func (ls Set) AsQuery() Query {
|
||||
return QueryFromSet(ls)
|
||||
// Convenience function: convert these labels to a selector.
|
||||
func (ls Set) AsSelector() Selector {
|
||||
return SelectorFromSet(ls)
|
||||
}
|
||||
|
Reference in New Issue
Block a user