@@ -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
glog .V (4 ).Infof ("NodeAddressesByProviderID(%q) called" , providerID )
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" )
@@ -156,7 +159,10 @@ func (cp *CloudProvider) InstanceType(ctx context.Context, name types.NodeName)
156
159
func (cp * CloudProvider ) InstanceTypeByProviderID (ctx context.Context , providerID string ) (string , error ) {
157
160
glog .V (4 ).Infof ("InstanceTypeByProviderID(%q) called" , providerID )
158
161
159
- instanceID := util .MapProviderIDToInstanceID (providerID )
162
+ instanceID , err := util .MapProviderIDToInstanceID (providerID )
163
+ if err != nil {
164
+ return "" , errors .Wrap (err , "MapProviderIDToInstanceID" )
165
+ }
160
166
inst , err := cp .client .Compute ().GetInstance (ctx , instanceID )
161
167
if err != nil {
162
168
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
glog .V (4 ).Infof ("InstanceExistsByProviderID(%q) called" , providerID )
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