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]>
Signed-off-by: Owen Farrell <[email protected]>
  • Loading branch information
owenfarrell and tombuildsstuff committed May 1, 2022
1 parent a95e1f0 commit 0b366dc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
11 changes: 6 additions & 5 deletions internal/services/synapse/synapse_firewall_rule_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ func resourceSynapseFirewallRuleCreateUpdate(d *pluginsdk.ResourceData, meta int
timeout, _ := ctx.Deadline()

stateConf := &pluginsdk.StateChangeConf{
Pending: []string{string(synapse.ProvisioningStateProvisioning)},
Target: []string{string(synapse.ProvisioningStateSucceeded)},
Refresh: firewallRuleProvisioningStateRefreshFunc(ctx, client, id),
MinTimeout: 1 * time.Minute,
Timeout: time.Until(timeout),
Pending: []string{string(synapse.ProvisioningStateProvisioning)},
Target: []string{string(synapse.ProvisioningStateSucceeded)},
Refresh: firewallRuleProvisioningStateRefreshFunc(ctx, client, id),
Delay: 1 * time.Minute,
Timeout: time.Until(timeout),
PollInterval: 15 * time.Second,
}
if _, err = stateConf.WaitForStateContext(ctx); err != nil {
return fmt.Errorf("waiting for provisioning state of %s: %+v", id, err)
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 @@ -125,11 +125,11 @@ func resourceSynapseManagedPrivateEndpointCreate(d *pluginsdk.ResourceData, meta
timeout, _ := ctx.Deadline()

stateConf := &pluginsdk.StateChangeConf{
Pending: []string{string(synapse.ProvisioningStateProvisioning)},
Target: []string{string(synapse.ProvisioningStateSucceeded)},
Refresh: managedPrivateEndpointProvisioningStateRefreshFunc(ctx, client, id),
MinTimeout: 1 * time.Minute,
Timeout: time.Until(timeout),
Pending: []string{string(synapse.ProvisioningStateProvisioning)},
Target: []string{string(synapse.ProvisioningStateSucceeded)},
Refresh: managedPrivateEndpointProvisioningStateRefreshFunc(ctx, client, id),
Timeout: time.Until(timeout),
PollInterval: 15 * time.Second,
}
if _, err = stateConf.WaitForStateContext(ctx); err != nil {
return fmt.Errorf("waiting for provisioning state of %s: %+v", id, err)
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 0b366dc

Please sign in to comment.