mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
return nil from NewClientConfig instead of empty struct
This commit is contained in:
parent
4e2433cfab
commit
135c6899e9
@ -155,14 +155,15 @@ func NewForConfig(c *$.Config|raw$) (*Clientset, error) {
|
||||
var err error
|
||||
$range .allGroups$ clientset.$.Group$Client, err =$.PackageName$.NewForConfig(&configShallowCopy)
|
||||
if err!=nil {
|
||||
return &clientset, err
|
||||
return nil, err
|
||||
}
|
||||
$end$
|
||||
clientset.DiscoveryClient, err = $.NewDiscoveryClientForConfig|raw$(&configShallowCopy)
|
||||
if err!=nil {
|
||||
glog.Errorf("failed to create the DiscoveryClient: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
return &clientset, err
|
||||
return &clientset, nil
|
||||
}
|
||||
`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user