@@ -97,7 +97,10 @@ func (cp *CloudProvider) NodeAddresses(ctx context.Context, name types.NodeName)
97
97
// in this method to obtain nodeaddresses.
98
98
func (cp * CloudProvider ) NodeAddressesByProviderID (ctx context.Context , providerID string ) ([]api.NodeAddress , error ) {
99
99
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
+ }
101
104
vnic , err := cp .client .Compute ().GetPrimaryVNICForInstance (ctx , cp .config .CompartmentID , instanceID )
102
105
if err != nil {
103
106
return nil , errors .Wrap (err , "GetPrimaryVNICForInstance" )
@@ -157,7 +160,10 @@ func (cp *CloudProvider) InstanceType(ctx context.Context, name types.NodeName)
157
160
func (cp * CloudProvider ) InstanceTypeByProviderID (ctx context.Context , providerID string ) (string , error ) {
158
161
cp .logger .With ("instanceID" , providerID ).Debug ("Getting instance type by provider id" )
159
162
160
- instanceID := util .MapProviderIDToInstanceID (providerID )
163
+ instanceID , err := util .MapProviderIDToInstanceID (providerID )
164
+ if err != nil {
165
+ return "" , errors .Wrap (err , "MapProviderIDToInstanceID" )
166
+ }
161
167
inst , err := cp .client .Compute ().GetInstance (ctx , instanceID )
162
168
if err != nil {
163
169
return "" , errors .Wrap (err , "GetInstance" )
@@ -183,7 +189,10 @@ func (cp *CloudProvider) CurrentNodeName(ctx context.Context, hostname string) (
183
189
// instance will be immediately deleted by the cloud controller manager.
184
190
func (cp * CloudProvider ) InstanceExistsByProviderID (ctx context.Context , providerID string ) (bool , error ) {
185
191
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
+ }
187
196
instance , err := cp .client .Compute ().GetInstance (ctx , instanceID )
188
197
if client .IsNotFound (err ) {
189
198
return false , nil
0 commit comments