kubernetes-client / python-base

Apache License 2.0
70 stars 185 forks source link

load_config is printing to stdout #263

Closed hterik closed 2 years ago

hterik commented 3 years ago

In config/init.py, when calling load_config and not running in a cluster, a warning message is printed to stdout.

This utility function might be used in context where the stdout is used for other purposes and can garble such data. Recommend use logging instead.

roycaihw commented 2 years ago

/assign

roycaihw commented 2 years ago

I think using logging is a good idea. Would you like to send a PR?

/unassign cc @yliaog @tomplus

Some thoughts:

  1. It's a behavior change. We need to make sure we document it, and existing users are okay with this change.
  2. Let's make sure the behavior in python and python-base are consistent. I took a quick look and there aren't many places where we use print in this client.
DiptoChakrabarty commented 2 years ago

/assign

roycaihw commented 2 years ago

This repo has been merged into the main python repo. We are archiving this repo. Please open a new issue in the main repo. Thanks!

/close

k8s-ci-robot commented 2 years ago

@roycaihw: Closing this issue.

In response to [this](https://github.com/kubernetes-client/python-base/issues/263#issuecomment-1066133166): >This repo has been merged into the main [python repo](https://github.com/kubernetes-client/python). We are archiving this repo. Please open a new issue in the main repo. Thanks! > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.