Skip to content

Commit

Permalink
Add providerID
Browse files Browse the repository at this point in the history
refer to aws implementation, add providerID in exists function
  • Loading branch information
jichenjc committed Mar 25, 2019
1 parent 564ebf7 commit a576674
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/cloud/openstack/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,13 @@ func (oc *OpenstackClient) Exists(ctx context.Context, cluster *clusterv1.Cluste
if err != nil {
return false, err
}

if instance != nil && (machine.Spec.ProviderID == nil || *machine.Spec.ProviderID == "") {
// This actually refers cluster-api-aws
providerID := fmt.Sprintf("openstack:////%s", instance.ID)
machine.Spec.ProviderID = &providerID
}

return instance != nil, err
}

Expand Down

0 comments on commit a576674

Please sign in to comment.