-
Notifications
You must be signed in to change notification settings - Fork 260
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
🐛 Ensure that existing ports also have correct tags and trunks #2256
base: main
Are you sure you want to change the base?
🐛 Ensure that existing ports also have correct tags and trunks #2256
Conversation
Hi @mquhuy. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
f345dc1
to
921813b
Compare
/ok-to-test |
dbd9ad8
to
777d80c
Compare
/retest |
no need to retest, the unit test failed |
777d80c
to
ce3bc0c
Compare
ce3bc0c
to
674ffd2
Compare
/retest |
1 similar comment
/retest |
674ffd2
to
4d04792
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.
This looks pretty much ready! I just have a couple of comments on the tests.
Signed-off-by: Huy Mai <[email protected]>
4d04792
to
fd992ba
Compare
Thank you @lentzi90 . I've fixed the errors you pointed out. |
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.
/approve
/cc @EmilienM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lentzi90 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 |
To avoid copy/pasting my thoughts, I'll share a thread on Slack about this PR: https://kubernetes.slack.com/archives/CFKJB65G9/p1732192515903409 |
if len(portSpec.Tags) > 0 { | ||
if err := s.replaceAllAttributesTags(eventObject, portResource, port.ID, portSpec.Tags); err != nil { | ||
record.Warnf(eventObject, "FailedReplaceTags", "Failed to replace port tags %s: %v", portSpec.Name, err) | ||
return 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.
Isn't this going to call replaceAllAttributesTags on every reconcile, regardless of whether they're already set?
existingPorts, err := s.client.ListPort(ports.ListOpts{ | ||
Name: portSpec.Name, | ||
NetworkID: portSpec.NetworkID, | ||
}) |
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.
We have the port IDs of ports we've already created. Can we fetch by port ID? We should fall back to fetch by name in case we created a port but failed to write it to the status, but ideally fetch by ID would be the default here.
What this PR does / why we need it:
When a port is created, it is tagged and explicitly checked if it needs a trunk, but if the port already exists for some reason, it is taken without any of those checking. This PR fixes that by adding a similar check for the existing ports, similar to the check in new ports.
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