Skip to content

Commit ba1fe7b

Browse files
bingikarthikBingi Narasimha Karthik
andauthored
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

30 files changed

+8354
-0
lines changed

docs/hugo/content/reference/_index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,18 @@ These resource(s) are available for use in the current release of ASO. Different
892892
|--------------------------------------------------------------------------------------|-------------|---------------|----------------|-------------------------------------------------------------------------------------------------------------------------------------|
893893
| [Workspace]({{< relref "/reference/operationalinsights/v1api20210601#Workspace" >}}) | 2021-06-01 | v1api20210601 | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/operationalinsights/v1api/v1api20210601_workspace.yaml) |
894894

895+
## Quota
896+
897+
To install the CRDs for these resources, your ASO configuration must include `quota.azure.com/*` as one of the configured CRD patterns. See [CRD Management in ASO](https://azure.github.io/azure-service-operator/guide/crd-management/) for details on doing this for both [Helm](https://azure.github.io/azure-service-operator/guide/crd-management/#helm) and [YAML](https://azure.github.io/azure-service-operator/guide/crd-management/#yaml) based installations.
898+
899+
### Next Release
900+
901+
Development of these new resources is complete and they will be available in the next release of ASO.
902+
903+
| Resource | ARM Version | CRD Version | Supported From | Sample |
904+
|----------|-------------|---------------|----------------|---------------------------------------------------------------------------------------------------------------------------|
905+
| Quota | 2025-09-01 | v1api20250901 | v2.16.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/quota/v1api20250901/v1api20250901_quota.yaml) |
906+
895907
## RedHatOpenShift
896908

897909
To install the CRDs for these resources, your ASO configuration must include `redhatopenshift.azure.com/*` as one of the configured CRD patterns. See [CRD Management in ASO](https://azure.github.io/azure-service-operator/guide/crd-management/) for details on doing this for both [Helm](https://azure.github.io/azure-service-operator/guide/crd-management/#helm) and [YAML](https://azure.github.io/azure-service-operator/guide/crd-management/#yaml) based installations.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Quota Supported Resources
3+
linktitle: Quota
4+
no_list: true
5+
---
6+
To install the CRDs for these resources, your ASO configuration must include `quota.azure.com/*` as one of the configured CRD patterns. See [CRD Management in ASO](https://azure.github.io/azure-service-operator/guide/crd-management/) for details on doing this for both [Helm](https://azure.github.io/azure-service-operator/guide/crd-management/#helm) and [YAML](https://azure.github.io/azure-service-operator/guide/crd-management/#yaml) based installations.
7+
8+
### Next Release
9+
10+
Development of these new resources is complete and they will be available in the next release of ASO.
11+
12+
| Resource | ARM Version | CRD Version | Supported From | Sample |
13+
|----------|-------------|---------------|----------------|---------------------------------------------------------------------------------------------------------------------------|
14+
| Quota | 2025-09-01 | v1api20250901 | v2.16.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/quota/v1api20250901/v1api20250901_quota.yaml) |
15+

v2/api/quota/customizations/quota_extension_types_gen.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
2+
github.com/Azure/azure-service-operator/v2/api/quota/customizations
3+
-------------------------------------------------------------------
4+
QuotaExtension: Object (0 properties)
5+

v2/api/quota/v1api20250901/arm/quota_spec_types_gen.go

Lines changed: 123 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)