Fix: remove unnecessary case in field selector (#5367)

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
This commit is contained in:
JohnJan
2022-11-17 10:20:40 +08:00
committed by GitHub
parent 44167aa47a
commit bd55ad516c

View File

@@ -100,10 +100,11 @@ func contains(secret *v1.Secret, queryValue query.Value) bool {
for _, requirement := range fieldSelector.Requirements() {
var negative bool
// supports '=', '==' and '!='.(e.g. ?fieldSelector=key1=value1,key2=value2)
// fields.ParseSelector(FieldSelector) has handled the case where the operator is '==' and converted it to '=',
// so case selection.DoubleEquals can be ignored here.
switch requirement.Operator {
case selection.NotEquals:
negative = true
case selection.DoubleEquals:
case selection.Equals:
negative = false
}