-
Notifications
You must be signed in to change notification settings - Fork 253
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
🐛 Remove cluster dependency to resolve ports #2040
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
/test pull-cluster-api-provider-openstack-e2e-full-test |
/test pull-cluster-api-provider-openstack-e2e-test |
@@ -413,30 +400,6 @@ func Test_reconcileDelete(t *testing.T) { | |||
}, | |||
wantRemoveFinalizer: true, | |||
}, | |||
{ |
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 had to remove this test, it was not passing anymore. No calls were made at all. I guess it's an upgrade issue?
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.
Sorry, barely got started with this review. I'll continue tomorrow.
return networkID, fixedIPs | ||
} | ||
|
||
func DefaultPortsOpts(openStackCluster *infrav1.OpenStackCluster, ports []infrav1.PortOpts, instanceTrunk bool) []infrav1.PortOpts { |
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.
nit: Can we kill PortOpts
everywhere except the type name (and eventually there, too: it's a PortSpec). These are just default ports.
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, I can do it separately and globally.
6fb7b8c
to
0e5028d
Compare
/test pull-cluster-api-provider-openstack-e2e-test |
|
||
defaultSecurityGroupIDs, err := s.GetSecurityGroups(spec.SecurityGroups) | ||
// If no ports are in the spec, returns an error. | ||
func (s *Service) ConstructPorts(portsOpts []infrav1.PortOpts, securityGroups []infrav1.SecurityGroupParam, instanceTrunk bool, clusterResourceName, baseName string, managedSecurityGroup *string, baseTags []string) ([]infrav1.ResolvedPortSpec, error) { |
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.
for myself, check whether securityGroups
could be renamed to defaultSecurityGroups
?
defaultSecurityGroupIDs, err := s.GetSecurityGroups(spec.SecurityGroups) | ||
// If no ports are in the spec, returns an error. | ||
func (s *Service) ConstructPorts(portsOpts []infrav1.PortOpts, securityGroups []infrav1.SecurityGroupParam, instanceTrunk bool, clusterResourceName, baseName string, managedSecurityGroup *string, baseTags []string) ([]infrav1.ResolvedPortSpec, error) { | ||
defaultSecurityGroupIDs, err := s.GetSecurityGroups(securityGroups) |
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.
for myself, check whether clusterResourceName
could be replaced by something with "description" in it, if it's only used for port description.
} | ||
resolvedPort.SecurityGroups = defaultSecurityGroupIDs | ||
resolvedPort.NetworkID, resolvedPort.FixedIPs, _ = defaultNetworkTarget(defaultNetwork) | ||
return nil, fmt.Errorf("no networks or ports found in the machine spec") |
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 could also return an empty list and noop.
The default network and some other ports parameters are now figured out outside of the port functions, so they don't rely on the OpenStack cluster anymore.
0e5028d
to
3a2ad29
Compare
@EmilienM: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
PR needs rebase. 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. |
What this PR does / why we need it:
The default network and some other ports parameters are now figured out
outside of the port functions, so they don't rely on the OpenStackMachine spec directly anymore.
/hold