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

Do not delete overriden security groups #2555

Merged
merged 1 commit into from
Jul 6, 2021

Conversation

sedefsavas
Copy link
Contributor

@sedefsavas sedefsavas commented Jun 30, 2021

/kind bug

What this PR does / why we need it:
We were deleting SGs looking at Status, which also includes overridden SGs.
Instead, during SG deletion, this PR only deletes the ones that have sigs.k8s.io/cluster-api-provider-aws/cluster/name: owned tag.

Also, allows overriding SGs partially. Before all default SGs must have been overridden or seeing this error:
"msg"="failed to reconcile security groups" "error"="security group overrides have been provided for some but not all roles - missing security group for role bastion" "cluster"="tagleme" "name"="tagleme" "namespace"="default" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster"

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

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

Do not delete security groups when provided as overrides

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority labels Jun 30, 2021
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 30, 2021
@0xVox
Copy link

0xVox commented Jun 30, 2021

Pulled this in and tested; it's fixed on my end! - thanks again for a really quick turnaround!

EDIT: Hang on, need to test again, but looks like we've still deleted all of the rules in the security groups (But not the SGs themselves)

EDIT 2: Yep, confirmed. delete op on AWSCluster no longer deleting the SGs, but all of the rules in the provided security groups still get deleted.

@sedefsavas
Copy link
Contributor Author

Thanks for checking, I will see what is going on.

@sedefsavas
Copy link
Contributor Author

Found the issue, we were revoking the rules for all SGs. Now fixed.
Thanks for catching this @0xVox

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jul 1, 2021
@k8s-ci-robot
Copy link
Contributor

@sedefsavas: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-provider-aws-e2e-blocking 7126bf6 link /test pull-cluster-api-provider-aws-e2e-blocking

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.

@randomvariable
Copy link
Member

/lgtm
/approve

will sort out the e2e in post tomorrow

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 6, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: randomvariable

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jul 6, 2021
@randomvariable
Copy link
Member

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority labels Jul 6, 2021
@k8s-ci-robot k8s-ci-robot merged commit 1ea61aa into kubernetes-sigs:main Jul 6, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.7.0 milestone Jul 6, 2021
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

securityGroupOverrides - AWS Resources deleted on AWSCluster delete
4 participants