Skip to content

Conversation

@michaelhtm
Copy link
Member

Description of changes:
Using resolved as a return value may not always lead to desired results.
When ResolveReferences is called for resources that don't reference any other resources, it returns a direct pointer to the desired resource instead of a copy. This causes an aliasing issue where modifications to the resolved resource inadvertently affect the desired resource.

Impact: When the ACK runtime adds conditions to the resolved resource (particularly on certain errors), these conditions are also applied to the desired resource since both variables point to the same object. This causes the status patch operation to fail detecting any differences, preventing condition updates from being persisted.

With these changes, we will start returning the copy of desired object if the object returned
by the controllers is nil.
If not, we will continue use the returned object.

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 a-hilaly and knottnt November 27, 2025 02:18
@ack-prow
Copy link

ack-prow bot commented Nov 27, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: michaelhtm

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:

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 approved label Nov 27, 2025
@ack-prow
Copy link

ack-prow bot commented Nov 27, 2025

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

Test name Commit Details Required Rerun command
verify-attribution b25caa9 link false /test verify-attribution
sqs-controller-test b25caa9 link true /test sqs-controller-test
sagemaker-controller-test b25caa9 link true /test sagemaker-controller-test
ec2-controller-test b25caa9 link true /test ec2-controller-test
unit-test b25caa9 link true /test unit-test
ecr-controller-test b25caa9 link true /test ecr-controller-test
iam-controller-test b25caa9 link true /test iam-controller-test
s3-controller-test b25caa9 link true /test s3-controller-test

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.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant