Skip to content

feat: Recreate TransitGateway/NatGatway if resource has deleted status #257

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

Merged
merged 1 commit into from
Apr 3, 2025

Conversation

michaelhtm
Copy link
Member

Issue #, if available:

Description of changes:
Currently if a TransitGateway is deleted on accident by calling the API
or console, it still dangles with a deleted state.

With this change, the controller will recreate the TransitGateway if the
resource has deleted state

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 requested review from a-hilaly and jlbutler April 2, 2025 00:31
@ack-prow ack-prow bot added the approved label Apr 2, 2025
Currently if a TransitGateway is deleted on accident by calling the API
or console, it still dangles with a `deleted` state.

With this change, the controller will recreate the TransitGateway
if the resource has `deleted` state

NatGateway getting the same changes
Copy link

ack-prow bot commented Apr 2, 2025

@michaelhtm: 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 cad57ad 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.

@@ -40,6 +56,7 @@ func (rm *resourceManager) customUpdateNATGateway(
// an error, then the update was successful and desired.Spec
// (now updated.Spec) reflects the latest resource state.
updated = rm.concreteResource(desired.DeepCopy())
updated.ko.Status = latest.ko.Status
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed

Copy link
Member Author

Choose a reason for hiding this comment

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

i don't want the latest.Status to be discarded..the state was never being patched when i tested it locally.
https://github.com/aws-controllers-k8s/runtime/blob/07dcd404a9a7bc3efe890791b910f9ec41712926/pkg/runtime/reconciler.go#L781

Copy link
Member Author

Choose a reason for hiding this comment

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

we do need some preCompareDeltas to ensure we ignore everything except tags tho..since that's the only field we can update

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.

👍

Copy link
Member

@rushmash91 rushmash91 left a comment

Choose a reason for hiding this comment

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

thanks @michaelhtm !
/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 3, 2025
@ack-prow ack-prow bot merged commit 0e3b7d8 into aws-controllers-k8s:main Apr 3, 2025
5 of 7 checks passed
Copy link

ack-prow bot commented Apr 3, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [a-hilaly,michaelhtm,rushmash91]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@michaelhtm michaelhtm changed the title feat: Recreate TransitGateway if resource has deleted status feat: Recreate TransitGateway/NatGatway if resource has deleted status Apr 14, 2025
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants