-
Notifications
You must be signed in to change notification settings - Fork 282
avoid duplicate error event #1655
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
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jichenjc 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 |
Good point. We should probably pull both events out of getOrCreateTrunk and generate them in the caller. Also, that error message should use |
|
there's only one usage, so update directly in the function... |
| if portOpts.Trunk != nil && *portOpts.Trunk { | ||
| trunk, err := s.getOrCreateTrunk(eventObject, clusterName, port.Name, port.ID) | ||
| if err != nil { | ||
| record.Warnf(eventObject, "FailedCreateTrunk", "Failed to create trunk for port %s: %v", portName, 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.
I was thinking keep this one and remove the events in getOrCreateTrunk()? By emitting the event at both error points we're no longer avoiding duplicating the error event.
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.
Yeah, I'd probably go with what Matt says here, but no strong preference.
Signed-off-by: jichen <[email protected]>
|
/test pull-cluster-api-provider-openstack-e2e-test |
|
/lgtm |
|
/lgtm |
|
/hold cancel |
What this PR does / why we need it:
this is from code read when doing other PR
seems we have event https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/pkg/cloud/services/networking/trunk.go#L73 so no need duplicate event to confuse admin
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:
TODOs:
/hold