mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +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
|
var err error
|
||||||
$range .allGroups$ clientset.$.Group$Client, err =$.PackageName$.NewForConfig(&configShallowCopy)
|
$range .allGroups$ clientset.$.Group$Client, err =$.PackageName$.NewForConfig(&configShallowCopy)
|
||||||
if err!=nil {
|
if err!=nil {
|
||||||
return &clientset, err
|
return nil, err
|
||||||
}
|
}
|
||||||
$end$
|
$end$
|
||||||
clientset.DiscoveryClient, err = $.NewDiscoveryClientForConfig|raw$(&configShallowCopy)
|
clientset.DiscoveryClient, err = $.NewDiscoveryClientForConfig|raw$(&configShallowCopy)
|
||||||
if err!=nil {
|
if err!=nil {
|
||||||
glog.Errorf("failed to create the DiscoveryClient: %v", err)
|
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