Skip to content

Commit 76bae78

Browse files
committed
Return InstanceNotFound err from ExternalID
Fixes: oracle#144
1 parent 360305f commit 76bae78

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/oci/instances.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,15 @@ func (cp *CloudProvider) ExternalID(ctx context.Context, nodeName types.NodeName
127127
}
128128

129129
// InstanceID returns the cloud provider ID of the node with the specified NodeName.
130-
// TODO (apryde): AWS and GCE use format /<zone>/<instanceid> - should we?
131130
func (cp *CloudProvider) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error) {
132131
glog.V(4).Infof("InstanceID(%q) called", nodeName)
133132

134133
name := mapNodeNameToInstanceName(nodeName)
135134
inst, err := cp.client.Compute().GetInstanceByNodeName(ctx, name)
136135
if err != nil {
136+
if client.IsNotFound(err) {
137+
return "", cloudprovider.InstanceNotFound
138+
}
137139
return "", errors.Wrap(err, "GetInstanceByNodeName")
138140
}
139141
return *inst.Id, nil

0 commit comments

Comments
 (0)