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

Ec2: Network ACL CR should support deletion when subnet association is present #154

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

nnbu
Copy link
Contributor

@nnbu nnbu commented Oct 17, 2023

Issue #, if available:

Description of changes:
Currently, when network acl cr has subnet association configured, we can not delete the cr. subnet association needs to be removed first and then cr can be deleted. This PR addresses this issue. When network acl CR is being deleted, the new change deletes subnet association from aws first and then deletes network acl from aws. This allows CR deletion to happen without any problem.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 17, 2023
@ack-prow
Copy link

ack-prow bot commented Oct 17, 2023

Hi @nnbu. Thanks for your PR.

I'm waiting for a aws-controllers-k8s 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.

@nnbu
Copy link
Contributor Author

nnbu commented Oct 20, 2023

@a-hilaly Please review when you get a chance

@a-hilaly
Copy link
Member

/ok-to-test

@ack-prow ack-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 24, 2023
pkg/resource/network_acl/hooks.go Outdated Show resolved Hide resolved
Comment on lines 253 to 256
if desired != nil {
vpcID = desired.ko.Spec.VPCID
aclID = desired.ko.Status.ID
} else {
vpcID = latest.ko.Spec.VPCID
aclID = latest.ko.Status.ID

}
Copy link
Member

Choose a reason for hiding this comment

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

Same philosophy comes back here, if we're reaching this level, it means that the resource exists, meaning that desired != nil and latest != nil

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleteOldAssociations is called from syncAssociation, which in turn is called from either of sdkCreate, sdkUpdate or sdkDelete.

In case of sdkDelete, desired will be nil.
In case of sdkCreate, latest will be nil.

@nnbu
Copy link
Contributor Author

nnbu commented Nov 1, 2023

I have addressed the comments. Please review when you get a chance. @a-hilaly

@ack-bot
Copy link
Collaborator

ack-bot commented Apr 29, 2024

Issues go stale after 180d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 60d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle stale

@ack-prow ack-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 29, 2024
@a-hilaly
Copy link
Member

a-hilaly commented Jun 4, 2024

/test all

@ack-bot
Copy link
Collaborator

ack-bot commented Aug 13, 2024

Stale issues rot after 60d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 60d of inactivity.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle rotten

@ack-prow ack-prow bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 13, 2024
@a-hilaly a-hilaly removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Sep 17, 2024
Copy link

ack-prow bot commented Sep 17, 2024

@nnbu: 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
ec2-verify-attribution 1c4ba67 link false /test ec2-verify-attribution

Full PR test history. Your PR dashboard.

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.

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

Thank you @nnbu !
/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 17, 2024
Copy link

ack-prow bot commented Sep 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, nnbu

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

@ack-prow ack-prow bot added the approved label Sep 17, 2024
@ack-prow ack-prow bot merged commit c8acc55 into aws-controllers-k8s:main Sep 17, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants