mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-28 03:32:29 +00:00
Merge pull request #62273 from atlassian/dont-log-when-error-returned
Automatic merge from submit-queue (batch tested with PRs 62273, 62461). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Don't log when error returned **What this PR does / why we need it**: Both logging and returning an error is an antipattern. If the caller wants it logged they will log it. And in this case it will be logged twice which is very confusing for debugging. **Release note**: ```release-note NONE ``` /kind cleanup /sig api-machinery Kubernetes-commit: 0b5fa0b94a2e147ddae2278623c89648c211d229
This commit is contained in:
commit
92a7e05901
@ -19,7 +19,6 @@ limitations under the License.
|
||||
package kubernetes
|
||||
|
||||
import (
|
||||
glog "github.com/golang/glog"
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
admissionregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1"
|
||||
admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1"
|
||||
@ -518,7 +517,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
|
||||
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
glog.Errorf("failed to create the DiscoveryClient: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
return &cs, nil
|
||||
|
Loading…
Reference in New Issue
Block a user