Skip to content

fix: check lambda Function latest status in sdkupdate #174

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

Merged

Conversation

michaelhtm
Copy link
Member

Issue #2433

Description of changes:
This change ensures the Lambda Function does not get stuck in pending.
This issue occurs because we check the desired Status, which is not in
sync with the latest Status in AWS.

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 jlbutler and knottnt May 22, 2025 18:27
@ack-prow ack-prow bot added the approved label May 22, 2025
Comment on lines +72 to +73
updatedStatusResource := rm.concreteResource(desired.DeepCopy())
updatedStatusResource.SetStatus(latest)
Copy link

Choose a reason for hiding this comment

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

Q: Am I correct in assuming that the reason for this is to set the ensure that the new Function status is applied the resource? Doesn't the controller normally handle updating the status field until the synced:when condition is met?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it usually does if there is no error. But since below here we were returning a requeue error, the Synced one is ignored.

We should probably have a patch in runtime handling this..

Comment on lines 404 to 406
if isFunctionPending(&resource{ko}) {
ackcondition.SetSynced(&resource{ko}, corev1.ConditionFalse, nil, nil)
}
Copy link

Choose a reason for hiding this comment

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

Is this necessary with synced:when set in generator.yaml?

@michaelhtm michaelhtm force-pushed the fix/requeuewhilepending branch from 5f926ee to 4f4693e Compare May 22, 2025 20:41
@rushmash91
Copy link
Member

thanks @michaelhtm !!
Can we have this regenerated with latest code-gen?

This change ensures the Lambda Function does not get stuck in `pending`.
This issue occurs because we check the desired Status, which is not in
sync with the latest Status in AWS.
@michaelhtm michaelhtm force-pushed the fix/requeuewhilepending branch from e52e832 to 98afbbe Compare June 9, 2025 21:07
Copy link

ack-prow bot commented Jun 9, 2025

@michaelhtm: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
lambda-verify-attribution 98afbbe link false /test lambda-verify-attribution

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@rushmash91
Copy link
Member

/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jun 9, 2025
Copy link

ack-prow bot commented Jun 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: michaelhtm, rushmash91

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [michaelhtm,rushmash91]

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 merged commit 6cd3204 into aws-controllers-k8s:main Jun 9, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants