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

[k8s] Suppress insecure request warnings #3888

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sky/adaptors/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
urllib3 = common.LazyImport('urllib3',
import_error_message=_IMPORT_ERROR_MESSAGE)

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will cause urllib3 being imported when the adaptors being imported, which may cause errors when skypilot is not installed with skypilot[kubernetes] or skypilot[all].

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, we only specify urllib3 in the dependency of aws, we should have it specified for kubernetes as well in setup.py

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, I have moved it to _load_config so that it is invoked only when a) _configured=False and b) other import checks have already been run.

urllib3 does not need to be explicitly specified in setup.py, since the kubernetes package depends on urllib3 and urllib3 will automatically be installed when kubernetes is installed.


_configured = False
_core_api = None
_auth_api = None
Expand Down
Loading