cluster-api-provider-openstack icon indicating copy to clipboard operation
cluster-api-provider-openstack copied to clipboard

⚠️ Remove PortOpts.SecurityGroupFilters

Open lentzi90 opened this issue 3 years ago • 5 comments

This replaces https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/1257.

What this PR does / why we need it:

Deprecating and replacing PortOpts.SecurityGroups of *[]string format field from OpenStackMachineTemplate ports and replace is with *[]SecurityGroupParam format. The PortOpts.SecurityGroupFilters of type []SecurityGroupParam is removed.

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 #1251

Special notes for your reviewer:

~~I opened a new PR instead of rebasing the existing since there are some issues and I'm unsure how to solve them. This way it will be easier to compare the rebased and original code side by side.~~

  1. ~~We need to provide a conversion function for the PortOpts.SecurityGroups field that changes from *[]string in v1alpha5 to *[]SecurityGroupParam in v1alpha6.~~
  2. ~~The same conversion is needed from v1alpha4 to v1alpha6 and this is where I'm having issues. The required name of the conversion function becomes the same for both v1alpha4 and v1alpha5 because it goes from *[]string which doesn't have a version.~~
    Convert_Slice_string_To_Slice_v1alpha6_SecurityGroupParam
    
    ~~If I add this conversion function to both v1alpha4 and v1alpha5, the generator complains that there is a duplicate.~~
  3. ~~If I instead add the conversion in only one place (e.g. v1alpha5), then the generator will be happy and import the conversion function in the other API version as well! But the compiler does not like this at all. It gets an import error.~~
    could not import ./api/v1alpha4 (no required module provides package "./api/v1alpha4")
    

~~This wasn't a problem in the original PR since it only needed the conversion from v1alpha4 -> v1alpha5 (so no duplicate function name or import needed). If you have any suggestions on how to solve this, please let me know.~~

Edit: I think I figured it out! By adding the conversion function in v1alpha6 instead of v1alpha5 and/or v1alpha4, I avoid the issue.

TODOs:

  • [x] squashed commits
  • if necessary:
    • [ ] includes documentation
    • [ ] adds unit tests

/hold

lentzi90 avatar Jul 04 '22 07:07 lentzi90

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

Name Link
Latest commit 20cd37a241a45ae292549ecd020b7799d86de203
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/64182cfb22118800086f6930
Deploy Preview https://deploy-preview-1291--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 settings.

netlify[bot] avatar Jul 04 '22 07:07 netlify[bot]

Hi @lentzi90. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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/test-infra repository.

k8s-ci-robot avatar Jul 04 '22 07:07 k8s-ci-robot

/ok-to-test

jichenjc avatar Jul 05 '22 00:07 jichenjc

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lentzi90 Once this PR has been reviewed and has the lgtm label, please assign tobiasgiese for approval by writing /assign @tobiasgiese in a comment. 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 avatar Aug 10 '22 13:08 k8s-ci-robot

/retest

lentzi90 avatar Aug 16 '22 13:08 lentzi90

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Dec 20 '22 11:12 k8s-triage-robot

/remove-lifecycle stale

lentzi90 avatar Dec 20 '22 11:12 lentzi90

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

lentzi90 avatar Dec 21 '22 06:12 lentzi90

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

lentzi90 avatar Dec 21 '22 07:12 lentzi90

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lentzi90 Once this PR has been reviewed and has the lgtm label, please assign tobiasgiese 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 avatar Mar 08 '23 11:03 k8s-ci-robot

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.

k8s-ci-robot avatar Mar 21 '23 23:03 k8s-ci-robot

@lentzi90: 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
pull-cluster-api-provider-openstack-e2e-test 20cd37a241a45ae292549ecd020b7799d86de203 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 avatar Mar 27 '23 14:03 k8s-ci-robot

Replaced by #1516 which just drops securityGroups instead of renaming securityGroupFilters to securityGroups and dropping the old securityGroups.

lentzi90 avatar Mar 27 '23 18:03 lentzi90