-
Notifications
You must be signed in to change notification settings - Fork 271
Description
Describe the bug
ACK tries to patch the resource during the initial reconciliation to handle putting the resource of the ID into the status field. However if something else patches the resource just before/at the same time to set something like an Owner resource, ACK will fail to Patch the resource and return an error which means the ID and any associated data for the resource that has been created will be lost.
This results in subsequent resource creation attempts to fail in some situations due to unique constraints on the AWS side (#1895) or in other cases you could end with duplicate resources until it succeeds or quota limits are hit on the AWS side e.g VPCs. It also results in deletes of parent resources blocking due to child resources that were created but not properly tracked and as such not being removed preventing the parent from being removed (e.g VPCs and Subnets).
Steps to reproduce
Pick a Resource that requires an ID to be stored in it's status for tracking purposes e.g a VPC.
Have the resource created by a controller or something similar that can set an owner reference on the resource.
Have the controller watch the resource in question and do it's own createorPatch watch ack logs for err where it fails to Patch.
Expected outcome
ACK gracefully tries the patch until success within reason to ensure no duplicate resources are created and resource IDs are recorded correctly.
Environment
- Kubernetes version: 1.32
- Using EKS (yes/no), if so version? no
- AWS service targeted (S3, RDS, etc.): EC2: VPC, Subnets