Skip to content

Commit

Permalink
Merge pull request #641 from l1b0k/fix/err
Browse files Browse the repository at this point in the history
fix: return err after roll back
  • Loading branch information
BSWANG authored Jun 7, 2024
2 parents a8c731c + a52d2ad commit 23ef06f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/aliyun/client/ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (a *OpenAPI) CreateNetworkInterface(ctx context.Context, opts ...CreateNetw

if err != nil {
rollBackFunc()
return nil, err
}

return FromCreateResp(resp), err
Expand Down Expand Up @@ -281,6 +282,7 @@ func (a *OpenAPI) AssignPrivateIPAddress(ctx context.Context, opts ...AssignPriv
})
if err != nil {
rollBackFunc()
return nil, err
}

ips, err := ip.ToIPAddrs(resp.AssignedPrivateIpAddressesSet.PrivateIpSet.PrivateIpAddress)
Expand Down Expand Up @@ -362,6 +364,7 @@ func (a *OpenAPI) AssignIpv6Addresses(ctx context.Context, opts ...AssignIPv6Add
})
if err != nil {
rollBackFunc()
return nil, err
}

ips, err := ip.ToIPAddrs(resp.Ipv6Sets.Ipv6Address)
Expand Down

0 comments on commit 23ef06f

Please sign in to comment.