Skip to content

Commit

Permalink
Merge pull request #615 from l1b0k/fix/err
Browse files Browse the repository at this point in the history
fix: default option
  • Loading branch information
BSWANG authored Apr 24, 2024
2 parents 52f0eaf + 6d7699b commit ada08d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/aliyun/client/ecs_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (c *CreateNetworkInterfaceOptions) Finish(idempotentKeyGen IdempotentKeyGen
argsHash := md5Hash(req)
req.ClientToken = idempotentKeyGen.GenerateKey(argsHash)

if c.Backoff != nil {
if c.Backoff == nil {
c.Backoff = &wait.Backoff{
Steps: 1,
}
Expand Down Expand Up @@ -124,7 +124,7 @@ func (c *AssignPrivateIPAddressOptions) Finish(idempotentKeyGen IdempotentKeyGen
argsHash := md5Hash(req)
req.ClientToken = idempotentKeyGen.GenerateKey(argsHash)

if c.Backoff != nil {
if c.Backoff == nil {
c.Backoff = &wait.Backoff{
Steps: 1,
}
Expand Down Expand Up @@ -165,7 +165,7 @@ func (c *AssignIPv6AddressesOptions) Finish(idempotentKeyGen IdempotentKeyGen) (
argsHash := md5Hash(req)
req.ClientToken = idempotentKeyGen.GenerateKey(argsHash)

if c.Backoff != nil {
if c.Backoff == nil {
c.Backoff = &wait.Backoff{
Steps: 1,
}
Expand Down
1 change: 1 addition & 0 deletions pkg/aliyun/client/ecs_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func TestCreateNetworkInterfaceOptions_Finish(t *testing.T) {
assert.Equal(t, niOptions.ResourceGroupID, req.ResourceGroupId)
assert.Equal(t, eniDescription, req.Description)
assert.Equal(t, "mockToken", req.ClientToken)
assert.NotNil(t, c.Backoff)

// Cleanup
cleanup()
Expand Down

0 comments on commit ada08d8

Please sign in to comment.