Skip to content

Conversation

@ytsarev
Copy link
Member

@ytsarev ytsarev commented Jan 7, 2025

Description of your changes

  • Parametrize Target for the Query Result
  • Update tests
  • Update examples

Tests

  • Unit
 go test -v -cover .
=== RUN   TestRunFunction
=== RUN   TestRunFunction/ResponseIsReturned
=== RUN   TestRunFunction/ResponseIsReturnedWithOptionalManagementGroups
=== RUN   TestRunFunction/ShouldUpdateXRStatus
--- PASS: TestRunFunction (0.00s)
    --- PASS: TestRunFunction/ResponseIsReturned (0.00s)
    --- PASS: TestRunFunction/ResponseIsReturnedWithOptionalManagementGroups (0.00s)
    --- PASS: TestRunFunction/ShouldUpdateXRStatus (0.00s)
PASS
coverage: 45.2% of statements
ok  	github.com/upboundcare/function-azresourcegraph	(cached)	coverage: 45.2% of statements
  • Integration
go run . --insecure --debug

crossplane render example/xr.yaml example/composition.yaml example/functions-dev.yaml --function-cr
apiVersion: apiextensions.crossplane.io/v1
edentials=example/secrets/azure-creds-real.yaml -r
---
apiVersion: example.crossplane.io/v1
kind: XR
metadata:
  name: example-xr
status:
  azResourceGraphQueryResult:
  - id: /subscriptions/<redacted>/resourceGroups/<tedacted/providers/Microsoft.Compute/virtualMachines/<redacted>
    location: centralus
    name: us-vm-zxqnj-2h59v
    type: microsoft.compute/virtualmachines
  ...
  conditions:
  - lastTransitionTime: "2024-01-01T00:00:00Z"
    reason: Available
    status: "True"
    type: Ready
---
apiVersion: render.crossplane.io/v1beta1
kind: Result
message: 'Query: "Resources | project name, location, type, id| where type =~ ''Microsoft.Compute/virtualMachines''
  | order by name desc"'
severity: SEVERITY_NORMAL
step: query-azresourcegraph

I have:

* Parametrize Target for the Query Result
* Update tests
* Update examples

Signed-off-by: Yury Tsarev <[email protected]>
Copy link

@kaessert kaessert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@ytsarev ytsarev merged commit c305d86 into main Jan 7, 2025
5 checks passed
@ytsarev ytsarev deleted the add-target-api branch January 7, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants