-
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
Add events recorder framework #632
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Unknown CLA label state. Rechecking for CLA labels. Send feedback to sig-contributor-experience at kubernetes/community. /check-cla |
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.
Overall approach lgmt, need few changes:
- I see the even reason now are more generic like
FailedCreate
orSuccessfulCreate
, it will be good if we have specific reasons e.gFailedCreateVPC
orSuccessfulCreateVPC
for the VPC resources. - Add fake recorder and add enhance the existing test cases to expect the records.
@@ -102,10 +103,12 @@ func (s *ClusterScope) CreateVPC() (*vpcv1.VPC, error) { | |||
options.SetName(s.IBMVPCCluster.Spec.VPC) | |||
vpc, _, err := s.IBMVPCClients.VPCService.CreateVPC(options) | |||
if err != nil { | |||
record.Warnf(s.IBMVPCCluster, "FailedCreate", "Failed vpc creation - %v", err) | |||
return nil, err | |||
} else if err := s.updateDefaultSG(*vpc.DefaultSecurityGroup.ID); err != nil { | |||
return nil, 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.
Need Warnf for this failure as well
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.
- Added
Warnf
for above failure. - Updated record reasons to be more specific.
How about we merge this version of the code and add fake recorder + enhance test cases as part of another PR?
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.
better to write test cases with the code itself, for this case we can add later
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.
I feel overall there can be more Success
condition can be added, have that said - this looks good for the initial version. Please fix all the comment and merge this code.
@@ -102,10 +103,12 @@ func (s *ClusterScope) CreateVPC() (*vpcv1.VPC, error) { | |||
options.SetName(s.IBMVPCCluster.Spec.VPC) | |||
vpc, _, err := s.IBMVPCClients.VPCService.CreateVPC(options) | |||
if err != nil { | |||
record.Warnf(s.IBMVPCCluster, "FailedCreate", "Failed vpc creation - %v", err) | |||
return nil, err | |||
} else if err := s.updateDefaultSG(*vpc.DefaultSecurityGroup.ID); err != nil { | |||
return nil, 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.
better to write test cases with the code itself, for this case we can add later
Signed-off-by: Prajyot-Parab <[email protected]>
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mkumatag, 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 |
Signed-off-by: Prajyot-Parab [email protected]
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 #547
Special notes for your reviewer:
/area provider/ibmcloud
Release note: