Skip to content

Commit 8885704

Browse files
authored
BUG: IBM Cloud Infra: Return existing VPC ID (#2141)
Fix bug where an existing VPC ID that was found, was not being returned, resulting in attempts to recreate the VPC. Related: #2140
1 parent 41a8998 commit 8885704

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: cloud/scope/vpc_cluster.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,13 @@ func (s *VPCClusterScope) GetVPCID() (*string, error) {
496496

497497
// Check if the VPC was found and has an ID
498498
if vpcDetails != nil && vpcDetails.ID != nil {
499-
// Set VPC ID in Status to shortcut future lookups
499+
// Set VPC ID in Status to shortcut future lookups, prior to returning the ID.
500500
s.SetResourceStatus(infrav1beta2.ResourceTypeVPC, &infrav1beta2.ResourceStatus{
501501
ID: *vpcDetails.ID,
502502
Name: s.NetworkSpec().VPC.Name,
503503
Ready: true,
504504
})
505+
return vpcDetails.ID, nil
505506
}
506507
}
507508
}

0 commit comments

Comments
 (0)