Skip to content

Commit

Permalink
fix: label selector is useless when name variable is not set (argopro…
Browse files Browse the repository at this point in the history
…j#5975)

when name variable is empty, the label selector is useless.

Signed-off-by: stanhrxu <[email protected]>
  • Loading branch information
xuhrc authored Jul 12, 2021
1 parent dec710e commit 9a788c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ func (s *Server) Watch(q *application.ApplicationQuery, ws application.Applicati
if appVersion, err := strconv.Atoi(a.ResourceVersion); err == nil && appVersion < minVersion {
return
}
matchedEvent := q.GetName() == "" || a.Name == q.GetName() && selector.Matches(labels.Set(a.Labels))
matchedEvent := (q.GetName() == "" || a.Name == q.GetName()) && selector.Matches(labels.Set(a.Labels))
if !matchedEvent {
return
}
Expand Down

0 comments on commit 9a788c3

Please sign in to comment.