mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
fix duplicate kube client
This commit is contained in:
parent
25c7b6a2c7
commit
f24e7ccf6a
@ -432,17 +432,12 @@ func (nim *nodeInfoManager) tryInitializeCSINodeWithAnnotation(csiKubeClient cli
|
|||||||
|
|
||||||
func (nim *nodeInfoManager) CreateCSINode() (*storagev1.CSINode, error) {
|
func (nim *nodeInfoManager) CreateCSINode() (*storagev1.CSINode, error) {
|
||||||
|
|
||||||
kubeClient := nim.volumeHost.GetKubeClient()
|
|
||||||
if kubeClient == nil {
|
|
||||||
return nil, fmt.Errorf("error getting kube client")
|
|
||||||
}
|
|
||||||
|
|
||||||
csiKubeClient := nim.volumeHost.GetKubeClient()
|
csiKubeClient := nim.volumeHost.GetKubeClient()
|
||||||
if csiKubeClient == nil {
|
if csiKubeClient == nil {
|
||||||
return nil, fmt.Errorf("error getting CSI client")
|
return nil, fmt.Errorf("error getting CSI client")
|
||||||
}
|
}
|
||||||
|
|
||||||
node, err := kubeClient.CoreV1().Nodes().Get(context.TODO(), string(nim.nodeName), metav1.GetOptions{})
|
node, err := csiKubeClient.CoreV1().Nodes().Get(context.TODO(), string(nim.nodeName), metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user