-
Notifications
You must be signed in to change notification settings - Fork 531
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
[Azure][Storage] Update Error response for accessing private container without access #3807
[Azure][Storage] Update Error response for accessing private container without access #3807
Conversation
@romilbhardwaj This is ready for a look! |
sky/data/storage.py
Outdated
is_private = (True if | ||
container_client.get_container_properties().get( | ||
'public_access', None) is None else False) | ||
# when user attempts to use private container without | ||
# access rights | ||
if self.resource_group_name is None and is_private: | ||
with ux_utils.print_exception_no_traceback(): | ||
raise exceptions.StorageBucketGetError( | ||
_BUCKET_FAIL_TO_CONNECT_MESSAGE.format( | ||
name=self.name)) |
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.
As discussed offline, we may want to retain some checks similar to this for the case where the storage account is accessible but some of the containers in the account are private.
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.
Thanks for catching this. Reverted the removal!
@romilbhardwaj This is ready for another look! |
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.
Thanks @landscapepainter! LGTM if tests pass.
This updates the temporary solution implemented at #3791
Error was incorrectly handled when the user attempted to access a private container without access. This PR fixes with correct error response.
Tested (run the relevant ones):
bash format.sh
task.yaml
raises:pytest tests/test_smoke.py::TestStorageWithCredentials --azure
pytest tests/test_smoke.py::test_fill_in_the_name
conda deactivate; bash -i tests/backward_compatibility_tests.sh