-
Notifications
You must be signed in to change notification settings - Fork 12
Mapo nets to ports #13
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
Mapo nets to ports #13
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: iamemilio The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test e2e-openstack |
|
Worker nodes don't come up. From MAPO logs: |
|
/hold needs a bugfix |
This code will convert all networks in the machine spec to capo ports, which will help us transition to a port only api in the future. This will disable some of the super user behavior, but that is for the better in the long run.
d1474a3 to
8a84a8b
Compare
|
/retest |
|
@iamemilio: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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/test-infra repository. I understand the commands that are listed here. |
|
The That's likely because the |
| portSecurity := net.PortSecurity | ||
| if net.PortSecurity != nil { | ||
| ps := *portSecurity | ||
| ps = !ps | ||
| portSecurity = &ps | ||
| } |
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.
It's hard to follow what you're doing here. Perhaps this makes it a bit easier to read?
| portSecurity := net.PortSecurity | |
| if net.PortSecurity != nil { | |
| ps := *portSecurity | |
| ps = !ps | |
| portSecurity = &ps | |
| } | |
| var disablePortSecurity NetworkParam.PortSecurity | |
| if net.PortSecurity != nil { | |
| ps := *portSecurity | |
| ps = !ps | |
| disablePortSecurity = &ps | |
| } |
Then you'd also need to modify line 198 with disablePortSecurity instead of portSecurity: https://github.com/openshift/machine-api-provider-openstack/pull/13/files#diff-0fca389902b53f54c2c5a39550587a96d9003a5713a8313db3d571ec72422993R198
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.
OK let’s start a contest!
this is my take at making things a little bit more readable:
var disablePortSecurity *bool
if portSecurity != nil {
disablePortSecurity = new(bool)
*disablePortSecurity = !*portSecurity
}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.
As far as I can tell, your code wants the new *bool to be nil if portsec is nil, or the opposite of portsec if it’s not nil.
if I wasn’t on a phone, I would dig and try to understand if you really need your new value to be a pointer. How many different behaviours can descend from it? If it’s just « disable » or « don’t disable », then you don’t need a pointer
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.
There are 3 behaviors: nil: use openstack default, &true: explicitly true, &false: explicitly false
| // Fetch the UUID of the network subnet is attached to or the conversion will fail | ||
| netID, err := subnet.Filter.getNetworkID(networkService) | ||
| if err != nil { | ||
| return []capov1.PortOpts{}, 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.
Didn't you mean to return the error?
| return []capov1.PortOpts{}, nil | |
| return []capov1.PortOpts{}, 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.
oops, yep
What is the meaning of this annotation? |
|
I fixed the comments you left. This patch wont make the tests green, but it looks like they did install all the way, which is important, and is what we were looking for |
We're tracking the remaining issue with https://bugzilla.redhat.com/show_bug.cgi?id=2033382. |
|
/hold cancel |
mandre
left a comment
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
/hold for CI
|
/hold cancel |
Converts all nets to ports and wires in allowed address pairs fix