Skip to content

fix: Update K8s Spec for read-only resources when AWS state diverges#250

Open
Mallikarjunadevops wants to merge 1 commit into
aws-controllers-k8s:mainfrom
Mallikarjunadevops:fix-readonly-spec-sync
Open

fix: Update K8s Spec for read-only resources when AWS state diverges#250
Mallikarjunadevops wants to merge 1 commit into
aws-controllers-k8s:mainfrom
Mallikarjunadevops:fix-readonly-spec-sync

Conversation

@Mallikarjunadevops
Copy link
Copy Markdown

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/runtime reads 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 Spec for 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/... via go test which successfully passed. Verified the changes apply exactly as intended for read-only sync logic.

@ack-prow ack-prow Bot requested review from a-hilaly and michaelhtm June 2, 2026 02:20
@ack-prow
Copy link
Copy Markdown

ack-prow Bot commented Jun 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Mallikarjunadevops
Once this PR has been reviewed and has the lgtm label, please assign a-hilaly for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 2, 2026
@ack-prow
Copy link
Copy Markdown

ack-prow Bot commented Jun 2, 2026

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 /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.

Details

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[eks controller] adopted resources with read only does not update the cluster version

2 participants