From 2ca2ac3b7a729932b62563c303add549ec49ca6a Mon Sep 17 00:00:00 2001 From: Karthik K N Date: Fri, 30 Jun 2023 13:00:39 +0530 Subject: [PATCH] UPSTREAM: : Add check for valid Power VS instance id --- ibm/ibm_powervs_client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ibm/ibm_powervs_client.go b/ibm/ibm_powervs_client.go index 183183e1a..fb649c7d1 100644 --- a/ibm/ibm_powervs_client.go +++ b/ibm/ibm_powervs_client.go @@ -175,6 +175,9 @@ func (p *ibmPowerVSClient) populateNodeMetadata(nodeName string, node *NodeMetad if pvsInstance == nil { return errors.New("Could not retrieve a Power instance: name=" + nodeName) } + if pvsInstance.PvmInstanceID == nil || *pvsInstance.PvmInstanceID == "" { + return fmt.Errorf("could not retrieve valid instance id for Power instance name: %s instance id: %v", nodeName, pvsInstance.PvmInstanceID) + } node.WorkerID = *pvsInstance.PvmInstanceID klog.Infof("Node %s worker id is %s", nodeName, node.WorkerID)