-
Notifications
You must be signed in to change notification settings - Fork 589
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
Conversation
sky/adaptors/kubernetes.py
Outdated
@@ -18,6 +18,8 @@ | |||
urllib3 = common.LazyImport('urllib3', | |||
import_error_message=_IMPORT_ERROR_MESSAGE) | |||
|
|||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) |
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.
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]
.
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.
Actually, we only specify urllib3
in the dependency of aws
, we should have it specified for kubernetes
as well in setup.py
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.
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.
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.
LGTM!
If user uses disables tls for k8s with
insecure-skip-tls-verify
in their kubeconfig, urllib3 prints warnings for each connection:This PR disables warnings with the method recommended by urllib3.
Tested (run the relevant ones):
bash format.sh