Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egoscale: update to v3.1.0 and fix #35

Merged
merged 2 commits into from
Jul 18, 2024
Merged

Conversation

sauterp
Copy link
Member

@sauterp sauterp commented Jul 17, 2024

Checklist

(For exoscale contributors)

  • Changelog updated (under Unreleased block)
  • Integration tests OK

@@ -333,8 +333,7 @@ func (d *controllerService) ControllerUnpublishVolume(ctx context.Context, req *

op, err := client.DetachBlockStorageVolume(ctx, volumeID)
if err != nil {
if errors.Is(err, v3.ErrNotFound) ||
(errors.Is(err, v3.ErrInvalidRequest) && strings.Contains(err.Error(), "Volume not attached")) {
if errors.Is(err, v3.ErrNotFound) || strings.Contains(err.Error(), "Volume not attached") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you now aware of which HTTP code the API is returning? ErrInvalidRequest before was a code range.
Anyway, just checking the error text should be enough for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. IMO the correct one for the API to return is ErrNotFound, if it's not that the API is incorrect IMO. But for user friendliness, let's keep the check on the error string as a fallback. Should be good.

@sauterp sauterp merged commit 948bd45 into main Jul 18, 2024
1 check passed
@sauterp sauterp deleted the philippsauter/fix-new-error branch July 18, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants