mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #84957 from ZP-AlwaysWin/dev-1105-1
Remove unnecessary judgment
This commit is contained in:
commit
35de7a2537
@ -67,7 +67,7 @@ func FilterPodsByNamespace(pods []*v1.Pod, ns string) []*v1.Pod {
|
|||||||
|
|
||||||
// CreateSelectorFromLabels is used to define a selector that corresponds to the keys in a map.
|
// CreateSelectorFromLabels is used to define a selector that corresponds to the keys in a map.
|
||||||
func CreateSelectorFromLabels(aL map[string]string) labels.Selector {
|
func CreateSelectorFromLabels(aL map[string]string) labels.Selector {
|
||||||
if aL == nil || len(aL) == 0 {
|
if len(aL) == 0 {
|
||||||
return labels.Everything()
|
return labels.Everything()
|
||||||
}
|
}
|
||||||
return labels.Set(aL).AsSelector()
|
return labels.Set(aL).AsSelector()
|
||||||
|
@ -82,7 +82,7 @@ var stackCreator = regexp.MustCompile(`(?m)^created by (.*)\n\s+(.*):(\d+) \+0x[
|
|||||||
func extractStackCreator() (string, int, bool) {
|
func extractStackCreator() (string, int, bool) {
|
||||||
stack := debug.Stack()
|
stack := debug.Stack()
|
||||||
matches := stackCreator.FindStringSubmatch(string(stack))
|
matches := stackCreator.FindStringSubmatch(string(stack))
|
||||||
if matches == nil || len(matches) != 4 {
|
if len(matches) != 4 {
|
||||||
return "", 0, false
|
return "", 0, false
|
||||||
}
|
}
|
||||||
line, err := strconv.Atoi(matches[3])
|
line, err := strconv.Atoi(matches[3])
|
||||||
|
Loading…
Reference in New Issue
Block a user