Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Harvey <[email protected]>
  • Loading branch information
owenfarrell and tombuildsstuff authored Sep 28, 2021
1 parent 66e7456 commit 91390cf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions internal/services/synapse/synapse_firewall_rule_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func resourceSynapseFirewallRuleCreateUpdate(d *pluginsdk.ResourceData, meta int
Refresh: firewallRuleProvisioningStateRefreshFunc(ctx, client, id),
MinTimeout: 1 * time.Minute,
Timeout: time.Until(timeout),
Interval: 15 * time.Second,
}
if _, err = stateConf.WaitForStateContext(ctx); err != nil {
return fmt.Errorf("waiting for provisioning state of %s: %+v", id, err)
Expand Down Expand Up @@ -169,11 +170,11 @@ func resourceSynapseFirewallRuleDelete(d *pluginsdk.ResourceData, meta interface

future, err := client.Delete(ctx, id.ResourceGroup, id.WorkspaceName, id.Name)
if err != nil {
return fmt.Errorf("deleting %s: %+v", id, err)
return fmt.Errorf("deleting %s: %+v", *id, err)
}

if err = future.WaitForCompletionRef(ctx, client.Client); err != nil {
return fmt.Errorf("waiting for deletion of %s: %+v", id, err)
return fmt.Errorf("waiting for deletion of %s: %+v", *id, err)
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (r SynapseFirewallRuleResource) Exists(ctx context.Context, client *clients
if utils.ResponseWasNotFound(resp.Response) {
return utils.Bool(false), nil
}
return nil, fmt.Errorf("retrieving %s: %+v", id, err)
return nil, fmt.Errorf("retrieving %s: %+v", *id, err)
}

return utils.Bool(true), nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func resourceSynapseManagedPrivateEndpointCreate(d *pluginsdk.ResourceData, meta
Refresh: managedPrivateEndpointProvisioningStateRefreshFunc(ctx, client, id),
MinTimeout: 1 * time.Minute,
Timeout: time.Until(timeout),
Interval: 15 * time.Second,
}
if _, err = stateConf.WaitForStateContext(ctx); err != nil {
return fmt.Errorf("waiting for provisioning state of %s: %+v", id, err)
Expand Down Expand Up @@ -162,7 +163,7 @@ func resourceSynapseManagedPrivateEndpointRead(d *pluginsdk.ResourceData, meta i
d.SetId("")
return nil
}
return fmt.Errorf("retrieving %s: %+v", id, err)
return fmt.Errorf("retrieving %s: %+v", *id, err)
}

workspaceId := parse.NewWorkspaceID(id.SubscriptionId, id.ResourceGroup, id.WorkspaceName)
Expand Down Expand Up @@ -192,7 +193,7 @@ func resourceSynapseManagedPrivateEndpointDelete(d *pluginsdk.ResourceData, meta
return err
}
if _, err := client.Delete(ctx, id.ManagedVirtualNetworkName, id.Name); err != nil {
return fmt.Errorf("deleting %s: %+v", id, err)
return fmt.Errorf("deleting %s: %+v", *id, err)
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (r SynapseManagedPrivateEndpointResource) Exists(ctx context.Context, clien
if utils.ResponseWasNotFound(resp.Response) {
return utils.Bool(false), nil
}
return nil, fmt.Errorf("retrieving %s: %+v", id, err)
return nil, fmt.Errorf("retrieving %s: %+v", *id, err)
}

return utils.Bool(true), nil
Expand Down

0 comments on commit 91390cf

Please sign in to comment.