Skip to content

Conversation

@naclonts
Copy link

Issue #, if available: aws-controllers-k8s/community#2394

Description of changes: Fix infinite reconciliation loop caused by KeyAlgorithm format mismatch between user input (underscores, e.g., RSA_2048) and AWS API response (dashes, e.g., RSA-2048).

Added normalizeKeyAlgorithm helper function in hooks.go and modified the SDK read template to normalize the value when reading from AWS. Includes e2e test coverage to verify the fix.

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 knottnt and michaelhtm December 11, 2025 20:32
@ack-prow
Copy link

ack-prow bot commented Dec 11, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: naclonts
Once this PR has been reviewed and has the lgtm label, please assign michaelhtm for approval by writing /assign @michaelhtm in a comment. For more information see the Kubernetes Code Review Process.

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

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 Dec 11, 2025
@ack-prow
Copy link

ack-prow bot commented Dec 11, 2025

Hi @naclonts. 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.

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.

}
// Normalize KeyAlgorithm to use underscores instead of dashes
// AWS API returns dashes (e.g., RSA-2048) but users specify underscores (e.g., RSA_2048)
if resp.Certificate.KeyAlgorithm != "" {
Copy link

Choose a reason for hiding this comment

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

If the issue is with the comparison logic specifically it might be best to perform this normalization logic in the delta comparison in delta.go instead of mutating the value returned by the API.

Copy link
Author

Choose a reason for hiding this comment

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

Makes sense! Just updated.

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.

2 participants