Secrets: Better error message for not matching resource owner (#109113)

This commit is contained in:
Matheus Macabu
2025-08-04 13:01:08 +02:00
committed by GitHub
parent 3a1c1b6232
commit a4ed9c4bb6
@@ -117,7 +117,10 @@ func (s *inlineSecureValueService) isSecureValueOwnedByResource(ctx context.Cont
return true, nil // The secure value is owned by the same owner reference, pass!
}
return false, fmt.Errorf("secure value %s is not owned by %v but by %v", name, owner, actualOwner)
return false, fmt.Errorf(
"secure value %s is not owned by %s/%s/%s/%s but by %s/%s/%s",
name, owner.APIGroup, owner.APIVersion, owner.Kind, owner.Name, actualOwner.APIVersion, actualOwner.Kind, actualOwner.Name,
)
}
// not owned