Skip to content

Commit

Permalink
Merge pull request #1112 from zhouhao3/handle-409-err
Browse files Browse the repository at this point in the history
Increase the handling of 409 errors when node creation fails
  • Loading branch information
metal3-io-bot committed Jul 28, 2022
2 parents af507c6 + 87a4c45 commit 6966480
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/provisioner/ironic/ironic.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,17 @@ func (p *ironicProvisioner) ValidateManagementAccess(data provisioner.Management
"capabilities": bootModeCapabilities[data.BootMode],
},
}).Extract()
// FIXME(dhellmann): Handle 409 and 503? errors here.
if err != nil {
switch err.(type) {
case nil:
p.publisher("Registered", "Registered new host")
case gophercloud.ErrDefault409:
p.log.Info("could not register host in ironic, busy")
result, err = retryAfterDelay(provisionRequeueDelay)
return
default:
result, err = transientError(errors.Wrap(err, "failed to register host in ironic"))
return
}
p.publisher("Registered", "Registered new host")

// Store the ID so other methods can assume it is set and so
// we can find the node again later.
Expand Down

0 comments on commit 6966480

Please sign in to comment.