File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 "strings"
88
99 "github.com/projectdiscovery/cloudlist/pkg/schema"
10+ "github.com/projectdiscovery/gologger"
1011 run "google.golang.org/api/run/v1"
1112)
1213
@@ -55,13 +56,16 @@ func (d *cloudRunProvider) getServices() ([]*run.Service, error) {
5556 locationsService := d .run .Projects .Locations .List (fmt .Sprintf ("projects/%s" , project ))
5657 locationsResponse , err := locationsService .Do ()
5758 if err != nil {
59+ gologger .Warning ().Msgf ("could not list cloud run locations for project %s: %s" , project , err )
5860 continue
5961 }
6062
6163 for _ , location := range locationsResponse .Locations {
62- servicesService := d .run .Projects .Locations .Services .List (location .Name )
63- servicesResponse , err := servicesService .Do ()
64+ // build the parent explicitly because the location.Name is not returned with the projects/ prefix in Knative API
65+ parent := fmt .Sprintf ("projects/%s/locations/%s" , project , location .LocationId )
66+ servicesResponse , err := d .run .Projects .Locations .Services .List (parent ).Do ()
6467 if err != nil {
68+ gologger .Warning ().Msgf ("could not list cloud run services for %s: %s" , parent , err )
6569 continue
6670 }
6771 services = append (services , servicesResponse .Items ... )
You can’t perform that action at this time.
0 commit comments