diff --git a/azure/services/disks/client.go b/azure/services/disks/client.go index c0d8fe628d8..04d0ecedc1a 100644 --- a/azure/services/disks/client.go +++ b/azure/services/disks/client.go @@ -60,8 +60,8 @@ func NewDisksClient(subscriptionID string, baseURI string, authorizer autorest.A // request to Azure and if accepted without error, the func will return a Future which can be used to track the ongoing // progress of the operation. func (ac *AzureClient) DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter) (azureautorest.FutureAPI, error) { - ctx, span := tele.Tracer().Start(ctx, "disks.AzureClient.Delete") - defer span.End() + ctx, _, done := tele.StartSpanWithLogger(ctx, "disks.Service.DeleteAsync") + defer done() future, err := ac.disks.Delete(ctx, spec.ResourceGroupName(), spec.ResourceName()) if err != nil { @@ -89,13 +89,13 @@ func (ac *AzureClient) Result(ctx context.Context, futureData azureautorest.Futu // IsDone returns true if the long-running operation has completed. func (ac *AzureClient) IsDone(ctx context.Context, future azureautorest.FutureAPI) (bool, error) { - ctx, span := tele.Tracer().Start(ctx, "disks.AzureClient.IsDone") - defer span.End() + ctx, _, done := tele.StartSpanWithLogger(ctx, "natgateways.Service.IsDone") + defer done() - done, err := future.DoneWithContext(ctx, ac.disks) + isDone, err := future.DoneWithContext(ctx, ac.disks) if err != nil { return false, errors.Wrap(err, "failed checking if the operation was complete") } - return done, nil + return isDone, nil } diff --git a/azure/services/disks/disks.go b/azure/services/disks/disks.go index 4b4a3fc0934..c4161e3f45a 100644 --- a/azure/services/disks/disks.go +++ b/azure/services/disks/disks.go @@ -57,13 +57,15 @@ func (s *Service) Reconcile(ctx context.Context) error { _, _, done := tele.StartSpanWithLogger(ctx, "disks.Service.Reconcile") defer done() + // TODO: what happens if we don't update the put status for the ready condition? + return nil } // Delete deletes the disk associated with a VM. func (s *Service) Delete(ctx context.Context) error { - ctx, span := tele.Tracer().Start(ctx, "disks.Service.Delete") - defer span.End() + _, _, done := tele.StartSpanWithLogger(ctx, "disks.Service.Delete") + defer done() ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultAzureServiceReconcileTimeout) defer cancel() diff --git a/azure/services/disks/spec.go b/azure/services/disks/spec.go index a15d8e7e745..db2616bb20b 100644 --- a/azure/services/disks/spec.go +++ b/azure/services/disks/spec.go @@ -16,13 +16,13 @@ limitations under the License. package disks -// DiskSpec defines the specification for a Disk. +// DiskSpec defines the specification for a disk. type DiskSpec struct { Name string ResourceGroup string } -// ResourceName returns the name of the virtual network peering. +// ResourceName returns the name of the disk. func (s *DiskSpec) ResourceName() string { return s.Name } @@ -32,12 +32,12 @@ func (s *DiskSpec) ResourceGroupName() string { return s.ResourceGroup } -// OwnerResourceName is a no-op for virtual network peerings. +// OwnerResourceName is a no-op for disks. func (s *DiskSpec) OwnerResourceName() string { return "" } -// Parameters returns the parameters for the virtual network peering. +// Parameters returns the parameters for the disk. func (s *DiskSpec) Parameters(existing interface{}) (interface{}, error) { return nil, nil }