Commit ba1fe7b
feat: Add Azure Quota resource support to ASO v2 (#4979)
* feat: Add Azure Quota resource support to ASO v2
* Update
* Review comments
* Remove unwanted file
* re-record the test
* remove resourcegroup file
* fix: Handle direct ARM reference owners in samples tester
Fix issue where Quota sample test failed with 'owner: , does not exist for resource 'Quota''.
The problem occurred because the Quota sample uses a direct ARM reference for its owner:
owner:
armId: /subscriptions/.../resourceGroups/aso-sample-rg
When converted to ResourceReference, direct ARM references have empty Kind/Group fields,
but the samples tester was trying to look up the owner by Kind in the samples map.
Changes:
- Add IsDirectARMReference() check before owner lookup in setSamplesOwnershipAndReferences()
- Skip owner validation for direct ARM references as they don't need lookup by Kind
- Preserve existing validation logic for Kubernetes resource references
- Add comprehensive unit tests for both ARM and Kubernetes reference scenarios
This fix allows resources with ARM ID owners (like Quota) to work correctly while
maintaining backward compatibility for existing Kubernetes resource references.
Fixes the failing Test_Quota_v1api20250901_CreationAndDeletion sample test.
* fix: Use standard Kubernetes reference pattern for Quota sample owner
Following review feedback, update the Quota sample to use the standard
Kubernetes reference pattern instead of direct ARM references.
Changes:
- Update owner reference in v1api20250901_quota.yaml to use:
name: aso-sample-rg
group: resources.azure.com
kind: ResourceGroup
- Add ResourceGroup reference in refs/ folder for test dependencies
- Remove direct ARM ID reference (armId: /subscriptions/.../resourceGroups/...)
This approach:
- Follows the existing sample patterns used throughout ASO
- Works with existing samples_tester logic without modifications
- Is simpler and more consistent with other resource samples
- Allows the ResourceGroup to be created as part of the test
Addresses review feedback from matthchr suggesting to follow the existing
sample pattern instead of modifying the samples tester logic.
* docs: Add README for Quota sample with Azure subscription configuration
Add comprehensive documentation for the Quota sample including:
- Sample structure and content explanation
- Testing instructions with Azure subscription ID (84bee13f-1f0f-4ba4-9fed-240486dd4710)
- Implementation notes explaining the evolution from ARM references to Kubernetes references
- Key benefits of following ASO conventions
The sample is now properly documented and ready for integration testing
when the test environment is fully configured.
* Remove README.md from Quota sample
Focus on getting the integration test to run successfully.
* fix: Correct quota sample ownership and test behavior for non-deletable resources
* Update comments
* Add empty recording file
* review comments
* Add suppression for quota
* Updates
* Update samples to correct structure
* run gofmt
---------
Co-authored-by: Bingi Narasimha Karthik <[email protected]>1 parent d94e174 commit ba1fe7b
File tree
30 files changed
+8354
-0
lines changed- docs/hugo/content/reference
- quota
- v2
- api/quota
- customizations
- v1api20250901
- arm
- storage
- webhook
- internal
- controllers
- recordings
- Test_Samples_CreationAndDeletion
- testcommon
- samples/quota/v1api20250901
30 files changed
+8354
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
895 | 907 | | |
896 | 908 | | |
897 | 909 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments