Merge pull request #105127 from astraw99/fix-dup-kubeClient

Fix duplicate CSI kube client
This commit is contained in:
Kubernetes Prow Robot 2021-12-07 17:25:30 -08:00 committed by GitHub
commit 8174b0923c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}