Skip to content

IBM Cloud Infrastructure provisioning fails to find an existing VPC when provided #2140

@cjschaef

Description

@cjschaef

/kind bug
/area provider/ibmcloud

What steps did you take and what happened:
[A clear and concise description of what the bug is.]
When attempting to provide an existing VPC for IBM Cloud Infrastructure provisioning, CAPI still attempts to create a new VPC, with the same name, thus failing due to name collision.

time="2024-12-26T10:40:07Z" level=debug msg="E1226 10:40:07.335078 482 ibmvpccluster_controller.go:241] \"failed to reconcile VPC\" err=\"failed to create vpc: error creating vpc: Provided Name (ci-op-ty2xb467-e5b9a-vpc) is not unique\"

What did you expect to happen:
CAPI will use the existing VPC to provision Infrastructure resources in, rather than attempting to create a new VPC.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
The issue occurs when the VPC ID that gets found, but fails to get returned.

The ID is not returned here, after it was found

// 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
s.SetResourceStatus(infrav1beta2.ResourceTypeVPC, &infrav1beta2.ResourceStatus{
ID: *vpcDetails.ID,
Name: s.NetworkSpec().VPC.Name,
Ready: true,
})
}

Environment:

  • Cluster-api version: v0.9.0
  • Minikube/KIND version: n/a
  • Kubernetes version: (use kubectl version): v1.32
  • OS (e.g. from /etc/os-release): ubuntu nobel

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/provider/ibmcloudIssues or PRs related to ibmcloud providerkind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions