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

Controller deleting existing/unmanaged resource #2102

Open
neilharris123 opened this issue Jun 27, 2024 · 2 comments
Open

Controller deleting existing/unmanaged resource #2102

neilharris123 opened this issue Jun 27, 2024 · 2 comments
Labels
area/runtime Issues or PRs as related to controller runtime, common reconciliation logic, etc kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@neilharris123
Copy link

neilharris123 commented Jun 27, 2024

Describe the bug

I recently used the IAM controller to create an IAM role. I found that if a role exists already (created outside of ACK) with the same name as the new role, not only does ACK throw an error initially (this is expected, obviously), but if I then modfiy the name of the new ACK managed role, the controller will proceed to delete the existing role (i.e., the role created outside of ACK).

Steps to reproduce

  1. Create the config for a new IAM role, with the same name as an existing role created by some other method (e.g. terraform, manually in the UI etc).
  2. Deploy the ACK config for the new ACK managed role, and view the error regarding "resource already exists"
  3. Modify the ACK config for the new role so that it no longer matches the existing resource, and push this change.
  4. The existing/old role, which apparently ACK should not be managing is deleted by the controller, and the new ACK configured role is created.

Expected outcome

I would not expect ACK to be able to do this. The original role was not created by ACK. No config was put in place for it to adopt the existing role. I don't believe it should be able to take control of such a resource and delete it. This is dangerous behaviour.

Environment

  • Kubernetes version
  • Using EKS yes- 1.29
  • AWS service targeted (IAM.)
@a-hilaly a-hilaly added kind/bug Categorizes issue or PR as related to a bug. area/runtime Issues or PRs as related to controller runtime, common reconciliation logic, etc priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/needs-information Indicates an issue needs more information in order to work on it. labels Jun 27, 2024
@a-hilaly
Copy link
Member

Thanks for reporting this @neilharris123 - this is a weird behaviour.. i'm a bit surprised since the controller doesn't make any delete calls unless of metadata.deletionTimestamp is set (to a non zero value).

@neilharris123
Copy link
Author

neilharris123 commented Jun 28, 2024

Could it be possible that the controller somehow took control of the existing resource, and changed the name, rather than deleted it? Or does this amount to the same thing i.e. delete and re-create?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/runtime Issues or PRs as related to controller runtime, common reconciliation logic, etc kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

2 participants