1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-19 01:17:04 +00:00

Enable filter namespaces on server side

This commit is contained in:
antmanler
2018-08-24 09:13:43 +08:00
parent 12c3f92bed
commit c159270dc1

View File

@@ -283,10 +283,11 @@ func getNamespace(apiContext *types.APIContext, opt *types.QueryOptions) string
} }
for _, condition := range opt.Conditions { for _, condition := range opt.Conditions {
if condition.Field == "namespaceId" && condition.Value != "" { mod := condition.ToCondition().Modifier
if condition.Field == "namespaceId" && condition.Value != "" && mod != types.ModifierIn && mod != types.ModifierNotIn {
return condition.Value return condition.Value
} }
if condition.Field == "namespace" && condition.Value != "" { if condition.Field == "namespace" && condition.Value != "" && mod != types.ModifierIn && mod != types.ModifierNotIn {
return condition.Value return condition.Value
} }
} }