Skip to content

Commit

Permalink
Merge pull request #979 from hashicorp/b/streamanalytics-additional-l…
Browse files Browse the repository at this point in the history
…ro-statuses

poller_lro: add `streamanalytics` cluster creation custom poller statuses
  • Loading branch information
jackofallops authored Apr 24, 2024
2 parents 61239bc + e2722da commit cbd1d98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions sdk/client/resourcemanager/poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func PollerFromResponse(response *client.Response, client *Client) (poller polle
if isLroStatus && lroPollingUri != "" && !methodIsDelete && !lroIsSelfReference {
lro, lroErr := longRunningOperationPollerFromResponse(response, client.Client)
if lroErr != nil {
err = lroErr
return pollers.Poller{}, fmt.Errorf("building long-running-operation poller: %+v", lroErr)
}
return pollers.NewPoller(lro, lro.initialRetryDuration, pollers.DefaultNumberOfDroppedConnectionsToAllow), nil
Expand All @@ -48,7 +47,6 @@ func PollerFromResponse(response *client.Response, client *Client) (poller polle
if statusCodesToCheckProvisioningState && contentTypeMatchesForProvisioningStateCheck && methodIsApplicable {
provisioningState, provisioningStateErr := provisioningStatePollerFromResponse(response, lroIsSelfReference, client, DefaultPollingInterval)
if provisioningStateErr != nil {
err = provisioningStateErr
return pollers.Poller{}, fmt.Errorf("building provisioningState poller: %+v", provisioningStateErr)
}
return pollers.NewPoller(provisioningState, provisioningState.initialRetryDuration, pollers.DefaultNumberOfDroppedConnectionsToAllow), nil
Expand All @@ -59,7 +57,6 @@ func PollerFromResponse(response *client.Response, client *Client) (poller polle
if methodIsDelete && statusCodesToCheckDelete {
deletePoller, deletePollerErr := deletePollerFromResponse(response, client, DefaultPollingInterval)
if deletePollerErr != nil {
err = deletePollerErr
return pollers.Poller{}, fmt.Errorf("building delete poller: %+v", deletePollerErr)
}
return pollers.NewPoller(deletePoller, deletePoller.initialRetryDuration, pollers.DefaultNumberOfDroppedConnectionsToAllow), nil
Expand Down
5 changes: 5 additions & 0 deletions sdk/client/resourcemanager/poller_lro.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ func (p *longRunningOperationPoller) Poll(ctx context.Context) (result *pollers.

// StorageSync@2020-03-01 returns `validateInput` rather than `InProgress` during creation/update (https://github.com/hashicorp/go-azure-sdk/issues/565)
"validateInput": pollers.PollingStatusInProgress,

// StreamAnalytics@2020-03-01 introduced "CreatingVirtualMachines", "ConfiguringNetworking", and "SettingUpStreamingRuntime" as undocumented granular statuses on 2024-04-09
"CreatingVirtualMachines": pollers.PollingStatusInProgress,
"ConfiguringNetworking": pollers.PollingStatusInProgress,
"SettingUpStreamingRuntime": pollers.PollingStatusInProgress,
}
for k, v := range statuses {
if strings.EqualFold(string(op.Properties.ProvisioningState), string(k)) {
Expand Down

0 comments on commit cbd1d98

Please sign in to comment.