Source resource owner from prev path if needed (#1949)
## Description Deleted collections have full path set to nil but have their previous path populated. When gathering information for statistics reporting, check that we have a non-nil value to get resource owner from. ## Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No ## Type of change - [ ] 🌻 Feature - [x] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Test - [ ] 💻 CI/Deployment - [ ] 🐹 Trivial/Minor ## Issue(s) * closes #1948 ## Test Plan - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
73c4937456
commit
76ebd7254d
@ -98,6 +98,18 @@ func ResourceOwnerSet(cs []Collection) []string {
|
||||
|
||||
for _, c := range cs {
|
||||
fp := c.FullPath()
|
||||
if fp == nil {
|
||||
// Deleted collections have their full path set to nil but the previous
|
||||
// path will be populated.
|
||||
fp = c.PreviousPath()
|
||||
}
|
||||
|
||||
if fp == nil {
|
||||
// This should not happen, but keep us from hitting a nil pointer
|
||||
// exception if it does somehow occur. Statistics will be off though.
|
||||
continue
|
||||
}
|
||||
|
||||
rs[fp.ResourceOwner()] = struct{}{}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user