fix bug can not search auditing logs with nil namespace

Signed-off-by: wanjunlei <wanjunlei@yunify.com>
This commit is contained in:
wanjunlei
2021-03-09 14:02:23 +08:00
parent 65f935d0df
commit a6cb91e6fb
4 changed files with 15 additions and 21 deletions

View File

@@ -154,7 +154,7 @@ func TestParseToQueryPart(t *testing.T) {
"filter":[
{
"match_phrase":{
"ObjectRef.Namespace":"kubesphere-system"
"ObjectRef.Namespace.keyword":"kubesphere-system"
}
},
{
@@ -172,7 +172,7 @@ func TestParseToQueryPart(t *testing.T) {
"filter":[
{
"match_phrase":{
"Workspace":"system-workspace"
"Workspace.keyword":"system-workspace"
}
},
{
@@ -218,7 +218,7 @@ func TestParseToQueryPart(t *testing.T) {
"should":[
{
"match_phrase":{
"Verb":"create"
"Verb.keyword":"create"
}
}
],
@@ -230,7 +230,7 @@ func TestParseToQueryPart(t *testing.T) {
"should":[
{
"match_phrase":{
"Level":"Metadata"
"Level.keyword":"Metadata"
}
}
],
@@ -328,7 +328,7 @@ func TestParseToQueryPart(t *testing.T) {
"should":[
{
"match_phrase":{
"ResponseStatus.status":"Failure"
"ResponseStatus.status.keyword":"Failure"
}
}
],