@@ -315,25 +315,30 @@ func (m *AppMonitor) appEventsSince(ctx context.Context, app application, t time
315315
316316// getSpace returns the Space entity described by the org, space pair.
317317func getSpace (ctx context.Context , cc * ccv2.Client , org , space string ) (ccv2.Space , error ) {
318- orgNameQuery := ccv2. Query {
319- Filter : ccv2 .FilterName ,
320- Op : ccv2 .OperatorEqual ,
321- Value : org ,
322- }
323- orgs , err := cc . Organizations ( ctx , orgNameQuery )
318+ orgs , err := cc . Organizations ( ctx ,
319+ ccv2.Query {
320+ Filter : ccv2 .FilterName ,
321+ Op : ccv2 . OperatorEqual ,
322+ Value : org ,
323+ } )
324324 if err != nil {
325325 return ccv2.Space {}, err
326326 }
327327 if len (orgs ) != 1 {
328328 return ccv2.Space {}, fmt .Errorf ("%q does not describe a single organization" , org )
329329 }
330330
331- spaceQuery := ccv2.Query {
332- Filter : ccv2 .FilterOrganizationGUID ,
333- Op : ccv2 .OperatorEqual ,
334- Value : orgs [0 ].GUID ,
335- }
336- spaces , err := cc .Spaces (ctx , spaceQuery )
331+ spaces , err := cc .Spaces (ctx ,
332+ ccv2.Query {
333+ Filter : ccv2 .FilterOrganizationGUID ,
334+ Op : ccv2 .OperatorEqual ,
335+ Value : orgs [0 ].GUID ,
336+ },
337+ ccv2.Query {
338+ Filter : ccv2 .FilterName ,
339+ Op : ccv2 .OperatorEqual ,
340+ Value : space ,
341+ })
337342 if err != nil {
338343 return ccv2.Space {}, err
339344 }
0 commit comments