fix: Update K8s Spec for read-only resources when AWS state diverges#250
fix: Update K8s Spec for read-only resources when AWS state diverges#250Mallikarjunadevops wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Mallikarjunadevops The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Mallikarjunadevops. 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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
Fixes aws-controllers-k8s/community#2856
What is this PR?
This PR fixes a bug where adopted resources with read-only mode enabled do not update their K8s Spec when the underlying AWS resource changes (e.g., an EKS cluster upgrade from 1.33 to 1.34).
Why?
When a resource is read-only, the
aws-controllers-k8s/runtimereads the latest state from AWS, compares it to the desired state in K8s, and detects differences. However, previously the reconciler would log"desired resource state has changed, but resource is read-only - skipping update"and return the resource WITHOUT patching the K8s API. This caused the K8s resource to become perpetually stale.With this PR, when the runtime detects a difference in
Specfor a read-only resource, it will now correctly patch the K8s API with the latest state fetched from AWS.Testing Evidence
Ran existing unit test suite in
pkg/runtime/...viago testwhich successfully passed. Verified the changes apply exactly as intended for read-only sync logic.