kubernetes-sigs / cluster-api-provider-ibmcloud

Cluster API Provider for IBM Cloud
https://cluster-api-ibmcloud.sigs.k8s.io
Apache License 2.0
62 stars 84 forks source link

Explicitly return error incase of not able to set provider id in correct format #2039

Closed Karthik-K-N closed 2 weeks ago

Karthik-K-N commented 2 weeks ago

What this PR does / why we need it:

This PR modifies the logic around setting provider id. There were many instances where provider id was not set properly and the cluster creation was not successfull. Main reason for that is service instance id being set empty.

Made changes to fetch service instance id from name if id not found in spec or status. This case will occur mainly when cluster is reconciled by external controller. Made changes to return error instead of empty string in case of not able to find service instance id.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #

Special notes for your reviewer:

/area provider/ibmcloud

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

netlify[bot] commented 2 weeks ago

Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!

Name Link
Latest commit a40918b6f6374f540b5d999afc91f0c822f9d46d
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-ibmcloud/deploys/672b87bf8f134f0007ff399b
Deploy Preview https://deploy-preview-2039--kubernetes-sigs-cluster-api-ibmcloud.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Karthik-K-N commented 2 weeks ago

/hold Ready for review but hold for some testing.

Karthik-K-N commented 2 weeks ago

/cc @dharaneeshvrd

Karthik-K-N commented 2 weeks ago

/unhold Verified creating a CAPI cluster and machine provider id was set as expected.

k8s-ci-robot commented 2 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dharaneeshvrd, Karthik-K-N, mkumatag

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/OWNERS)~~ [mkumatag] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment