Skip to content

Conversation

@jichenjc
Copy link
Contributor

@jichenjc jichenjc commented Sep 7, 2023

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:

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

TODOs:

  • squashed commits
  • if necessary:
    • includes documentation
    • adds unit tests

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 7, 2023
@netlify
Copy link

netlify bot commented Sep 7, 2023

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

Name Link
🔨 Latest commit 60d78f8
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/64ffd2ac6970360008dcf9aa
😎 Deploy Preview https://deploy-preview-1655--kubernetes-sigs-cluster-api-openstack.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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 7, 2023
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 7, 2023
@dulek
Copy link
Contributor

dulek commented Sep 7, 2023

@mdbooth
Copy link
Contributor

mdbooth commented Sep 7, 2023

What about this error now?

https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/pkg/cloud/services/networking/trunk.go#L58

Good point. We should probably pull both events out of getOrCreateTrunk and generate them in the caller.

Also, that error message should use %w rather than %v.

@jichenjc
Copy link
Contributor Author

jichenjc commented Sep 8, 2023

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)
Copy link
Contributor

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.

Copy link
Contributor

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.

@jichenjc
Copy link
Contributor Author

/test pull-cluster-api-provider-openstack-e2e-test

@dulek
Copy link
Contributor

dulek commented Sep 12, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 12, 2023
@mdbooth
Copy link
Contributor

mdbooth commented Sep 12, 2023

/lgtm

@jichenjc
Copy link
Contributor Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 13, 2023
@k8s-ci-robot k8s-ci-robot merged commit 01b5263 into kubernetes-sigs:main Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants