Skip to content

Conversation

@iamemilio
Copy link
Contributor

Converts all nets to ports and wires in allowed address pairs fix

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 14, 2021

[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

Details 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 14, 2021
@mandre
Copy link
Member

mandre commented Dec 15, 2021

/test e2e-openstack

@mandre
Copy link
Member

mandre commented Dec 15, 2021

Worker nodes don't come up.

From MAPO logs:

2021-12-15T13:44:49.627165518Z E1215 13:44:49.627097       1 actuator.go:416] Machine error 09nspy7c-39327-z6jqq-worker-0-b4cbk: error creating Openstack instance: network filter for port  returns more than one result
2021-12-15T13:44:49.627246661Z W1215 13:44:49.627230       1 controller.go:367] 09nspy7c-39327-z6jqq-worker-0-b4cbk: failed to create machine: error creating Openstack instance: network filter for port  returns more than one result
2021-12-15T13:44:49.627449566Z E1215 13:44:49.627419       1 controller.go:317] controller/machine_controller "msg"="Reconciler error" "error"="error creating Openstack instance: network filter for port  returns more than one result" "name"="09nspy7c-39327-z6jqq-worker-0-b4cbk" "namespace"="openshift-machine-api" 

@iamemilio
Copy link
Contributor Author

/hold needs a bugfix

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 15, 2021
Emilio Garcia added 2 commits December 15, 2021 14:37
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.
@iamemilio
Copy link
Contributor Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@iamemilio: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-openstack 8a84a8b link false /test e2e-openstack

Full PR test history. Your PR dashboard.

Details

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/test-infra repository. I understand the commands that are listed here.

@mandre
Copy link
Member

mandre commented Dec 16, 2021

The "[sig-installer][Feature:openstack] The OpenStack platform on instance creation should follow machineset specs [Suite:openshift/conformance/parallel]" test failed.

That's likely because the metadata.annotations.openstack-resourceId annotation is missing from the machines in the machineset.

https://github.com/openshift/openstack-test/blob/13bb9fd/test/extended/openstack/servers.go#L71

Comment on lines 86 to 91
portSecurity := net.PortSecurity
if net.PortSecurity != nil {
ps := *portSecurity
ps = !ps
portSecurity = &ps
}
Copy link
Member

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?

Suggested change
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

Copy link
Member

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
	}

https://go.dev/play/p/EPPYFDA1LQc

Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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?

Suggested change
return []capov1.PortOpts{}, nil
return []capov1.PortOpts{}, err

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, yep

@iamemilio
Copy link
Contributor Author

The "[sig-installer][Feature:openstack] The OpenStack platform on instance creation should follow machineset specs [Suite:openshift/conformance/parallel]" test failed.

That's likely because the metadata.annotations.openstack-resourceId annotation is missing from the machines in the machineset.

https://github.com/openshift/openstack-test/blob/13bb9fd/test/extended/openstack/servers.go#L71

What is the meaning of this annotation?

@iamemilio
Copy link
Contributor Author

iamemilio commented Dec 16, 2021

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

@mandre mandre closed this Dec 16, 2021
@mandre
Copy link
Member

mandre commented Dec 16, 2021

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.

@mandre mandre reopened this Dec 16, 2021
@iamemilio
Copy link
Contributor Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 16, 2021
Copy link
Member

@mandre mandre left a 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

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 16, 2021
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2021
@iamemilio
Copy link
Contributor Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 17, 2021
@openshift-merge-robot openshift-merge-robot merged commit 11d415e into openshift:master Dec 17, 2021
@pierreprinetti pierreprinetti deleted the mapo-nets-to-ports branch December 17, 2021 21:02
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants