Skip to content

Commit

Permalink
Merge pull request #509 from Patryk-Stefanski/OCPBUGS-32470
Browse files Browse the repository at this point in the history
[release-4.13] OCPBUGS-32470: UPSTREAM: 4670:Update awsmachine providerID and instanceID immediately after ec2:RunInstances is called
  • Loading branch information
openshift-merge-bot[bot] authored Apr 22, 2024
2 parents de23838 + 1007d91 commit 27360a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cloud/services/ec2/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ func (s *Service) CreateInstance(scope *scope.MachineScope, userData []byte, use
return nil, err
}

// Set the providerID and instanceID as soon as we create an instance so that we keep it in case of errors afterward
scope.SetProviderID(out.ID, out.AvailabilityZone)
scope.SetInstanceID(out.ID)

if len(input.NetworkInterfaces) > 0 {
for _, id := range input.NetworkInterfaces {
s.scope.Debug("Attaching security groups to provided network interface", "groups", input.SecurityGroupIDs, "interface", id)
Expand Down

0 comments on commit 27360a3

Please sign in to comment.