mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 04:52:08 +00:00
check for empty label before assigning
This commit is contained in:
parent
bb72237375
commit
80bc560489
@ -341,6 +341,10 @@ func (b *Builder) LabelSelectorParam(s string) *Builder {
|
|||||||
// LabelSelector accepts a selector directly and will filter the resulting list by that object.
|
// LabelSelector accepts a selector directly and will filter the resulting list by that object.
|
||||||
// Use LabelSelectorParam instead for user input.
|
// Use LabelSelectorParam instead for user input.
|
||||||
func (b *Builder) LabelSelector(selector string) *Builder {
|
func (b *Builder) LabelSelector(selector string) *Builder {
|
||||||
|
if len(selector) == 0 {
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
b.labelSelector = &selector
|
b.labelSelector = &selector
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user