Skip to content

🐛 allNodesSecurityGroupRules: relax remote fields#2077

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
shiftstack:issue_2075
May 14, 2024
Merged

🐛 allNodesSecurityGroupRules: relax remote fields#2077
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
shiftstack:issue_2075

Conversation

@EmilienM
Copy link
Contributor

@EmilienM EmilienM commented May 14, 2024

What this PR does / why we need it:

This does the following:
Don't make remoteManagedGroups required, since a user can use remoteIPPrefix instead or even no remote parameter at all.
It's fine because Neutron will set it to an fully-open CIDR if no remote field is provided.

We made wrong assumptions when writing this and we're now relaxing it.

Which issue(s) this PR fixes:
Fixes #2075

  • squashed commits
  • if necessary:
    • includes documentation
    • adds unit tests

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 14, 2024
@k8s-ci-robot k8s-ci-robot requested review from jichenjc and lentzi90 May 14, 2024 15:44
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 14, 2024
@netlify
Copy link

netlify bot commented May 14, 2024

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

Name Link
🔨 Latest commit 392f092
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/6643bb06313a040008eed2e3
😎 Deploy Preview https://deploy-preview-2077--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
Copy link
Contributor Author

/cc mdbooth jnummelin

@k8s-ci-robot k8s-ci-robot requested a review from mdbooth May 14, 2024 15:46
@k8s-ci-robot
Copy link
Contributor

@EmilienM: GitHub didn't allow me to request PR reviews from the following users: jnummelin.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

/cc mdbooth jnummelin

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-sigs/prow repository.

@EmilienM
Copy link
Contributor Author

/cherry-pick release-0.10

@k8s-infra-cherrypick-robot

@EmilienM: once the present PR merges, I will cherry-pick it on top of release-0.10 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-0.10

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-sigs/prow repository.

}
} else {
if rule.RemoteGroupID == nil && rule.RemoteIPPrefix == nil {
return nil, fmt.Errorf("remoteManagedGroups or remoteGroupID or remoteIPPrefix must be set for allNodes security group rules")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm missing something here. Why can't we just add the rule without either remote group id or remote ip prefix?

Copy link
Contributor Author

@EmilienM EmilienM May 14, 2024

Choose a reason for hiding this comment

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

This was confusing to me because:

  • openstackclient sets a default IP prefix to 0.0.0.0/0 if no remote parameter is set. Source.
  • Gophercloud doesn't have a default for that string.
  • When creating the Security Group Rule with Gophercloud (reproducer), the returned object has no Remote IP prefix, however openstackclient would show it to 0.0.0.0/0 (logs).

So I think we can disable this rule since apparently there is a default provided by Neutron.

@huxcrux
Copy link
Contributor

huxcrux commented May 14, 2024

/lgtm

Nice catch :)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 14, 2024
@EmilienM
Copy link
Contributor Author

/hold I'll fix what we commented with Matt first.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 14, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 14, 2024
@EmilienM EmilienM changed the title 🐛 allNodesSecurityGroupRules: require at least one remote parameter 🐛 allNodesSecurityGroupRules: relax remote fields May 14, 2024
@EmilienM
Copy link
Contributor Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 14, 2024
Don't make `remoteManagedGroups` required, since a user can use
`remoteIPPrefix` instead or even no remote parameter at all.
It's fine because Neutron will set it to an fully-open CIDR if no
remote field is provided.
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 14, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mdbooth

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 14, 2024
@huxcrux
Copy link
Contributor

huxcrux commented May 14, 2024

This behavior is even better :)
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 14, 2024
@k8s-ci-robot k8s-ci-robot merged commit 701ad7c into kubernetes-sigs:main May 14, 2024
@k8s-infra-cherrypick-robot

@EmilienM: new pull request created: #2080

Details

In response to this:

/cherry-pick release-0.10

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-sigs/prow repository.

@pierreprinetti pierreprinetti deleted the issue_2075 branch October 16, 2024 12:07
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Cannot add SG rule with remoteIPPrefix

5 participants