-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
provider/azure: Provide a simpler error when using a Platform Image without a Storage Service #2861
Conversation
cc @svanharmelen and @aznashwan for some Azure provider input, I'm new to it 😄 |
LGTM! PR #2607 is likely going to change this part even more to make it even more user friendly (through it's a bit silent there lately), but until that PR is done and merged, this is a good intermediate step I think. |
@@ -647,7 +651,7 @@ func retrieveOSImageDetails( | |||
if img.MediaLink == "" { | |||
if storage == "" { | |||
return nil, "", nil, | |||
fmt.Errorf("When using a platform image, the 'storage' parameter is required") | |||
PlatformStorageError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extremely small nit, but since the line is now way shorter there's not much reason to place PlatformStorageError
on it's own line... Through it doesn't hurt either of course! 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure, it's better on one line 😄 , done in 4885874
provider/azure: Provide a simpler error when using a Platform Image without a Storage Service
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Currently, when attempting to use a Platform Image without a Storage Service, you get a cryptic and misleading error:
The error is originating here:
But we're swallowing that specific error and returning a more generic one here:
This obfuscates what the underlying problem is and the user can't self-diagnose and correct.
My patch does a few things, and we can pick what we like:
errors
file to consolidate some common errors, but only has aPlatformStorageError
for nowPlatformStorageError
afterretrieveOSImageDetails
, and returns that error afterwardsNew output:
I've introduced the specific errors here to help trap any errors thrown but also maintain the current fall-through flow in
retrieveImageDetails
(ifretrieveVMImageDetails
errors, then still tryretrieveOSImageDetails
, and error at the end).