Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EmilienM
Copy link
Contributor

@EmilienM EmilienM commented Apr 29, 2024

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

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 29, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mdbooth for approval. For more information see the Kubernetes Code Review Process.

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

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 29, 2024
Copy link

netlify bot commented Apr 29, 2024

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

Name Link
🔨 Latest commit 3a2ad29
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/66325bccb3a5ba0008fbbea2
😎 Deploy Preview https://deploy-preview-2040--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.

@EmilienM EmilienM changed the title Remove cluster dependency to resolve ports 🐛 Remove cluster dependency to resolve ports Apr 29, 2024
@EmilienM
Copy link
Contributor Author

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

@EmilienM
Copy link
Contributor Author

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

@@ -413,30 +400,6 @@ func Test_reconcileDelete(t *testing.T) {
},
wantRemoveFinalizer: true,
},
{
Copy link
Contributor Author

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?

Copy link
Contributor

@mdbooth mdbooth left a 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 {
Copy link
Contributor

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.

Copy link
Contributor Author

@EmilienM EmilienM Apr 30, 2024

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.

@EmilienM
Copy link
Contributor Author

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


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

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

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

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.
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 1, 2024
@k8s-ci-robot
Copy link
Contributor

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

Test name Commit Details Required Rerun command
pull-cluster-api-provider-openstack-e2e-full-test 6fb7b8c link false /test pull-cluster-api-provider-openstack-e2e-full-test
pull-cluster-api-provider-openstack-test 3a2ad29 link true /test pull-cluster-api-provider-openstack-test
pull-cluster-api-provider-openstack-e2e-test 3a2ad29 link true /test pull-cluster-api-provider-openstack-e2e-test

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 2, 2024
@k8s-ci-robot
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Inbox
Development

Successfully merging this pull request may close these issues.

None yet

3 participants