-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use zone to filter PowerVS service instance #1853
Use zone to filter PowerVS service instance #1853
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
836af54
to
46c74bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good to me, But trying to understand when there were two service instance with same name , why didn't you hit this error here
default:
errStr := fmt.Errorf("there exist more than one service instance ID with same name %s, Try setting serviceInstance.ID", name)
Also within the same zone we can't have the same service instance right?
Problem I faced is, let's say there is an existing powervs instance called
But for this unfortunately it still allows duplicate within zone too. |
Got the point now, Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
This is exactly my doubt too, we can't foolproof 100% here in this case, we need to mention somewhere in the api spec saying that if multiple instance with same name present then it will pick first in the list and if user wants to use any specific one then use by ID |
cloud/scope/powervs_image.go
Outdated
Client client.Client | ||
Logger logr.Logger | ||
IBMPowerVSImage *infrav1beta2.IBMPowerVSImage | ||
ServiceInstanceZone *string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ServiceInstanceZone *string | |
Zone *string |
cloud/scope/powervs_machine.go
Outdated
@@ -178,9 +179,10 @@ func NewPowerVSMachineScope(params PowerVSMachineScopeParams) (scope *PowerVSMac | |||
serviceInstanceName = fmt.Sprintf("%s-%s", params.IBMPowerVSCluster.GetName(), "serviceInstance") | |||
if params.IBMPowerVSCluster.Spec.ServiceInstance != nil && params.IBMPowerVSCluster.Spec.ServiceInstance.Name != nil { | |||
serviceInstanceName = *params.IBMPowerVSCluster.Spec.ServiceInstance.Name | |||
zone = params.IBMPowerVSCluster.Spec.Zone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will it make any difference? why don't we just pass params.IBMPowerVSCluster.Spec.Zone directly in the below function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. changed.
46c74bc
to
e2dd106
Compare
e2dd106
to
e50f895
Compare
Updated the ServiceInstance field's description, ptal! |
@@ -65,6 +65,7 @@ type IBMPowerVSClusterSpec struct { | |||
// when omitted system will dynamically create the service instance with name CLUSTER_NAME-serviceInstance. | |||
// when ServiceInstance.ID is set, its expected that there exist a service instance in PowerVS workspace with id or else system will give error. | |||
// when ServiceInstance.Name is set, system will first check for service instance with Name in PowerVS workspace, if not exist system will create new instance. | |||
// if there are more than one service instance exist with the ServiceInstance.Name in given Zone, installation fails with an error. Use ServiceInstance.ID in those situations to use the specific service instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this failure logic written?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dharaneeshvrd, 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:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
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 #1839
Special notes for your reviewer:
/area provider/ibmcloud
Release note: