File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ All notable changes to the **Prowler SDK** are documented in this file.
3636- Update AWS CodeArtifact service metadata to new format [ (#8850 )] ( https://github.com/prowler-cloud/prowler/pull/8850 )
3737- Rename OCI provider to oraclecloud with oci alias [ (#9126 )] ( https://github.com/prowler-cloud/prowler/pull/9126 )
3838
39+ ### Fixed
40+ - Check ` check_name ` has no ` resource_name ` error for GCP provider [ (#9169 )] ( https://github.com/prowler-cloud/prowler/pull/9169 )
41+
3942---
4043
4144## [ v5.13.1] (Prowler UNRELEASED)
Original file line number Diff line number Diff line change @@ -588,8 +588,17 @@ def __init__(
588588 or getattr (resource , "name" , None )
589589 or ""
590590 )
591+
592+ # Prefer the explicit resource_name argument, otherwise look for a name attribute on the resource
593+ resource_name_candidate = resource_name or getattr (resource , "name" , None )
594+ if not resource_name_candidate and isinstance (resource , dict ):
595+ # Some callers pass a dict, so fall back to the dict entry if available
596+ resource_name_candidate = resource .get ("name" )
597+ if isinstance (resource_name_candidate , str ):
598+ # Trim whitespace so empty strings collapse to the default
599+ resource_name_candidate = resource_name_candidate .strip ()
591600 self .resource_name = (
592- resource_name or getattr ( resource , "name" , "" ) or "GCP Project"
601+ str ( resource_name_candidate ) if resource_name_candidate else "GCP Project"
593602 )
594603 self .project_id = project_id or getattr (resource , "project_id" , "" )
595604 self .location = (
You can’t perform that action at this time.
0 commit comments