@@ -97,7 +97,10 @@ func (cp *CloudProvider) NodeAddresses(ctx context.Context, name types.NodeName)
9797// in this method to obtain nodeaddresses.
9898func (cp * CloudProvider ) NodeAddressesByProviderID (ctx context.Context , providerID string ) ([]api.NodeAddress , error ) {
9999 cp .logger .With ("instanceID" , providerID ).Debug ("Getting node addresses by provider id" )
100- instanceID := util .MapProviderIDToInstanceID (providerID )
100+ instanceID , err := util .MapProviderIDToInstanceID (providerID )
101+ if err != nil {
102+ return nil , errors .Wrap (err , "MapProviderIDToInstanceID" )
103+ }
101104 vnic , err := cp .client .Compute ().GetPrimaryVNICForInstance (ctx , cp .config .CompartmentID , instanceID )
102105 if err != nil {
103106 return nil , errors .Wrap (err , "GetPrimaryVNICForInstance" )
@@ -157,7 +160,10 @@ func (cp *CloudProvider) InstanceType(ctx context.Context, name types.NodeName)
157160func (cp * CloudProvider ) InstanceTypeByProviderID (ctx context.Context , providerID string ) (string , error ) {
158161 cp .logger .With ("instanceID" , providerID ).Debug ("Getting instance type by provider id" )
159162
160- instanceID := util .MapProviderIDToInstanceID (providerID )
163+ instanceID , err := util .MapProviderIDToInstanceID (providerID )
164+ if err != nil {
165+ return "" , errors .Wrap (err , "MapProviderIDToInstanceID" )
166+ }
161167 inst , err := cp .client .Compute ().GetInstance (ctx , instanceID )
162168 if err != nil {
163169 return "" , errors .Wrap (err , "GetInstance" )
@@ -183,7 +189,10 @@ func (cp *CloudProvider) CurrentNodeName(ctx context.Context, hostname string) (
183189// instance will be immediately deleted by the cloud controller manager.
184190func (cp * CloudProvider ) InstanceExistsByProviderID (ctx context.Context , providerID string ) (bool , error ) {
185191 cp .logger .With ("instanceID" , providerID ).Debug ("Checking instance exists by provider id" )
186- instanceID := util .MapProviderIDToInstanceID (providerID )
192+ instanceID , err := util .MapProviderIDToInstanceID (providerID )
193+ if err != nil {
194+ return false , err
195+ }
187196 instance , err := cp .client .Compute ().GetInstance (ctx , instanceID )
188197 if client .IsNotFound (err ) {
189198 return false , nil
0 commit comments