-
Notifications
You must be signed in to change notification settings - Fork 89
Adopt CAPI v1beta2 status changes and respective controller changes for IBMPowerVSCluster #2312
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
Adopt CAPI v1beta2 status changes and respective controller changes for IBMPowerVSCluster #2312
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
IBMPowerVSCluster object's status field looks like this on various stages now.
|
8abbc48
to
56b5d3b
Compare
cloud/scope/powervs_cluster.go
Outdated
} | ||
if vpcDetails == nil { | ||
return false, fmt.Errorf("failed to get VPC with ID %s", *vpcID) | ||
return false, fmt.Errorf("vpc not found with ID %s", *vpcID) |
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.
return false, fmt.Errorf("vpc not found with ID %s", *vpcID) | |
return false, fmt.Errorf("VPC with ID %s not found", *vpcID) |
cloud/scope/powervs_cluster.go
Outdated
if err != nil { | ||
return false, err | ||
return false, fmt.Errorf("error checking VPC: %w", err) |
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.
return false, fmt.Errorf("error checking VPC: %w", err) | |
return false, fmt.Errorf("failed to check if VPC exists: %w", err) |
cloud/scope/powervs_cluster.go
Outdated
} | ||
if len(vpcZones) == 0 { | ||
return false, fmt.Errorf("failed to fetch VPC zones, no zone found for region %s", *s.VPC().Region) | ||
} | ||
// check whether user has set the vpc subnets | ||
if len(s.IBMPowerVSCluster.Spec.VPCSubnets) == 0 { | ||
// if the user did not set any subnet, we try to create subnet in all the zones. | ||
log.V(3).Info("VPC subnets are not set, constructing one") |
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.
log.V(3).Info("VPC subnets are not set, constructing one") | |
log.V(3).Info("VPC subnets details are not set in spec, creating subnets in all zones in the given region") |
cloud/scope/powervs_cluster.go
Outdated
return false, err | ||
log.V(3).Info("Only VPC connection not exist in transit gateway, creating it") | ||
if err := s.createTransitGatewayConnection(ctx, transitGateway.ID, ptr.To(getTGVPCConnectionName(*transitGateway.Name)), vpcCRN, vpcNetworkConnectionType); err != nil { | ||
return false, fmt.Errorf("failed to create VPC transit gateway connections: %w", err) |
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.
return false, fmt.Errorf("failed to create VPC transit gateway connections: %w", err) | |
return false, fmt.Errorf("failed to create VPC transit gateway connection: %w", err) |
cloud/scope/powervs_cluster.go
Outdated
return false, err | ||
log.V(3).Info("Only PowerVS connection not exist in transit gateway, creating it") | ||
if err := s.createTransitGatewayConnection(ctx, transitGateway.ID, ptr.To(getTGPowerVSConnectionName(*transitGateway.Name)), pvsServiceInstanceCRN, powervsNetworkConnectionType); err != nil { | ||
return false, fmt.Errorf("failed to create PowerVS transit gateway connections: %w", err) |
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.
return false, fmt.Errorf("failed to create PowerVS transit gateway connections: %w", err) | |
return false, fmt.Errorf("failed to create PowerVS transit gateway connection: %w", err) |
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.
Maybe missed to address in latest commits, please take care!
Not to be handled in this PR but for future, we should consider
|
56b5d3b
to
849f4c6
Compare
Yes, We are planning to do the same in our next api version where we plan to support multi-workspace,
Yes, Agree, next iteration will fix the correct verb |
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.
Minor nits.
overall lgtm.
/lgtm |
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.
Minor nits on logging
Few places you have reduced the logging level, please recheck them once
When ever we check resource in cloud, we say found in cloud. IMO just found also makes sense. e.g.: Found PowerVS service instance in cloud -> Found PowerVS service instance
cloud/scope/powervs_cluster.go
Outdated
if err != nil { | ||
return "", false, err | ||
return "", false, fmt.Errorf("failed to check for service instance state: %w", err) |
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.
return "", false, fmt.Errorf("failed to check for service instance state: %w", err) | |
return "", false, fmt.Errorf("failed to check service instance state: %w", err) |
cloud/scope/powervs_cluster.go
Outdated
return false, err | ||
log.V(3).Info("Only PowerVS connection not exist in transit gateway, creating it") | ||
if err := s.createTransitGatewayConnection(ctx, transitGateway.ID, ptr.To(getTGPowerVSConnectionName(*transitGateway.Name)), pvsServiceInstanceCRN, powervsNetworkConnectionType); err != nil { | ||
return false, fmt.Errorf("failed to create PowerVS transit gateway connections: %w", err) |
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.
Maybe missed to address in latest commits, please take care!
cloud/scope/powervs_cluster.go
Outdated
err = s.checkLoadBalancerPort(loadBalancer) | ||
if err != nil { |
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.
err = s.checkLoadBalancerPort(loadBalancer) | |
if err != nil { | |
if err = s.checkLoadBalancerPort(loadBalancer); err != nil { |
cloud/scope/powervs_cluster.go
Outdated
if err != nil { | ||
return err | ||
return fmt.Errorf("failed to check if cos instance in cloud: %w", err) |
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.
return fmt.Errorf("failed to check if cos instance in cloud: %w", err) | |
return fmt.Errorf("failed to check if COS instance in cloud: %w", err) |
Thank you for the revew, I have addressed all your comments. Since we check for id of various resources in status, previously we kept "found in cloud" just to indicate that we are looking specifically in cloud. |
/retest |
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.
minor nit, LGTM!
api/v1beta2/conditions_consts.go
Outdated
// VPCSecurityGroupDeletingV1Beta2Reason surfaces when the VPC security group is being deleted. | ||
VPCSecurityGroupDeletingV1Beta2Reason = capiv1beta1.DeletingV1Beta2Reason | ||
|
||
// TransitGatewayReadyV1Beta2Condition reports on the successful reconciliation of a PowerVS transit gateway. |
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.
// TransitGatewayReadyV1Beta2Condition reports on the successful reconciliation of a PowerVS transit gateway. | |
// TransitGatewayReadyV1Beta2Condition reports on the successful reconciliation of a transit gateway. |
api/v1beta2/conditions_consts.go
Outdated
IBMPowerVSClusterNotReadyV1Beta2Reason = capiv1beta1.NotReadyV1Beta2Reason | ||
|
||
// IBMPowerVSClusterReadyUnknownV1Beta2Reason surfaces when at least one of the IBMPowerVSCluster readiness criteria is unknown | ||
// and none of the IBMPowerVSCluster readiness criteria is not met. |
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.
// and none of the IBMPowerVSCluster readiness criteria is not met. | |
// and none of the IBMPowerVSCluster readiness criteria is met. |
cc54762
to
0ecada7
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Karthik-K-N, Prajyot-Parab 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 |
/unhold |
What this PR does / why we need it:
This PR consists of following changes
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 #2264
Special notes for your reviewer:
/area provider/ibmcloud
Release note: