-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the parent of a Tenant Resource to be OperationsBase #1392
Make the parent of a Tenant Resource to be OperationsBase #1392
Conversation
@@ -121,7 +121,7 @@ public AvailabilitySetsCreateOrUpdateOperation StartCreateOrUpdate(string availa | |||
} | |||
|
|||
var originalResponse = _restClient.CreateOrUpdate(Id.ResourceGroupName, availabilitySetName, parameters, cancellationToken: cancellationToken); | |||
return new AvailabilitySetsCreateOrUpdateOperation(Parent, originalResponse); | |||
return new AvailabilitySetsCreateOrUpdateOperation(this, originalResponse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? This looks like quite a big difference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally, I wanted to avoid using the Parent
as much as possible as ResourceContainerBase
has a constructor that does not set Parent
, so Parent
could be null. But it will cause other issues to use this
here. I reverted the change.
Co-authored-by: Arcturus <ufo54153@gmail.com>
<!-- <PackageReference Include="Azure.ResourceManager.Core" Version="1.0.0-alpha.20210706.2" /> --> | ||
<ProjectReference Include="../../../../azure-sdk-for-net/sdk/resourcemanager/Azure.ResourceManager.Core/src/Azure.ResourceManager.Core.csproj" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After Azure/azure-sdk-for-net#22589 is merged and published, use the new version of core.
/check-enforcer evaluate |
Description
A container of tenant resource whose direct parent is tenant (for instance, the billing account resource in
TenantOnly
tests) should be able to get created withTenantOperations
which is of typeOperationsBase
instead ofResourceOperationsBase
.This PR makes corresponding changes to support that and relies on core changes Azure/azure-sdk-for-net#22589
Todo:
TenantOperationsExtensionWriter
.ListAsGenericResourceAsync()
,Parent
is cast asResourceGroupOperations
. This does not apply for resources whose ancestor is subscription or tenant (here a subscription ancestor means subscription has a direct child resource that is not a resource group, that child resource and the children of that child resource, their ancestor is subscription. A tenant ancestor is similar. Each resource's ancestor is either a resource group, a subscription or a tenant).Checklist
To ensure a quick review and merge, please ensure:
Ready to Land?