File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -953,7 +953,8 @@ func (p *policiesCfg) addWAFConfig(
953
953
954
954
if waf .ApPolicy != "" {
955
955
apPolKey := waf .ApPolicy
956
- if ! strings .Contains (apPolKey , "/" ) {
956
+ hasNamepace := strings .Contains (apPolKey , "/" )
957
+ if ! hasNamepace {
957
958
apPolKey = fmt .Sprintf ("%v/%v" , polNamespace , apPolKey )
958
959
}
959
960
@@ -970,7 +971,8 @@ func (p *policiesCfg) addWAFConfig(
970
971
p .WAF .ApSecurityLogEnable = true
971
972
972
973
logConfKey := waf .SecurityLog .ApLogConf
973
- if ! strings .Contains (logConfKey , "/" ) {
974
+ hasNamepace := strings .Contains (logConfKey , "/" )
975
+ if ! hasNamepace {
974
976
logConfKey = fmt .Sprintf ("%v/%v" , polNamespace , logConfKey )
975
977
}
976
978
Original file line number Diff line number Diff line change @@ -2106,7 +2106,7 @@ func TestGetWAFPoliciesForAppProtectLogConf(t *testing.T) {
2106
2106
pols : policies ,
2107
2107
key : "ns2/logConf" ,
2108
2108
want : []* conf_v1.Policy {logConfNs2 },
2109
- msg : "WAF pols that ref apPol which is in another ns" ,
2109
+ msg : "WAF pols that ref logConf which is in another ns" ,
2110
2110
},
2111
2111
{
2112
2112
pols : policies ,
You can’t perform that action at this time.
0 commit comments