Skip to content

Commit

Permalink
BUG: IBM Cloud Infra: Return existing VPC ID (#2141)
Browse files Browse the repository at this point in the history
Fix bug where an existing VPC ID that was found, was not
being returned, resulting in attempts to recreate the
VPC.

Related: #2140
  • Loading branch information
cjschaef authored Jan 22, 2025
1 parent 41a8998 commit 8885704
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cloud/scope/vpc_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,12 +496,13 @@ func (s *VPCClusterScope) GetVPCID() (*string, error) {

// Check if the VPC was found and has an ID
if vpcDetails != nil && vpcDetails.ID != nil {
// Set VPC ID in Status to shortcut future lookups
// Set VPC ID in Status to shortcut future lookups, prior to returning the ID.
s.SetResourceStatus(infrav1beta2.ResourceTypeVPC, &infrav1beta2.ResourceStatus{
ID: *vpcDetails.ID,
Name: s.NetworkSpec().VPC.Name,
Ready: true,
})
return vpcDetails.ID, nil
}
}
}
Expand Down

0 comments on commit 8885704

Please sign in to comment.