mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #105127 from astraw99/fix-dup-kubeClient
Fix duplicate CSI kube client
This commit is contained in:
commit
8174b0923c
@ -432,17 +432,12 @@ func (nim *nodeInfoManager) tryInitializeCSINodeWithAnnotation(csiKubeClient cli
|
||||
|
||||
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()
|
||||
if csiKubeClient == nil {
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user