Closed theunrepentantgeek closed 11 months ago
A temporary workaround is to elide the Domains
property for now. This will allow everything else about the resource to work in the meantime, and we can restore the property once the underlying bug is fixed.
To do this, add the following to the typeTransformers
section of azure-arm.yaml
:
- group: cdn
name: SecurityPolicyWebApplicationFirewallAssociation
property: Domains
remove: true
because: Spec type ActivatedResourceReference maps to multiple status types, and this is currently not supported. See #3395 for details
Please include the AFD endpoint route resource to reproduce the error.
cdn:
2023-05-01:
Profiles_AFDEndpoints_Route:
$exportAs: ProfilesAFDEndpointRoute
$supportedFrom: v2.4.0
Profiles_SecurityPolicy:
$exportAs: ProfilesSecurityPolicy
$supportedFrom: v2.4.0
Version of Azure Service Operator
All versions up to 2.3.0
Describe the bug
When injecting the functions used to initialize the resource spec from its status (as used by
asoctl import azure-resource
), an assumption is made that there is a one-to-one mapping between spec and status types. This assumption does not hold.To Reproduce
Add (or merge) the following configuration into
azure-arm.yaml
:When the generator is run, the following error is emitted:
Pulling the key information out of this, we get the following details:
The spec type
ActivatedResourceReference
has an existing mapping to the status typeActivatedResourceReference_STATUS_Profiles_AfdEndpoints_Route_SubResourceEmbedded
which conflicts with creating a mapping toActivatedResourceReference_STATUS_Profiles_SecurityPolicy_SubResourceEmbedded
.Expected behavior
Valid OpenAPI specifications should not cause issues for the generator.
Additional context
In addition to fixing the underlying bug, we should also improve the error message to make it less impenetrable.