Skip to content

Conversation

knottnt
Copy link
Contributor

@knottnt knottnt commented Sep 16, 2025

Issue #, if available:

Description of changes:

  • Add config field only_set_unchanged_fields to UpdateOperationConfig.
  • Add CRD.OnlySetChangedFieldsOnUpdate() func to check if only_set_unchanged_fields value
  • Add logic in SetResource to add delta.DifferentAt() checks when only_set_unchanged_fields is set.
  • Create unit test to verify new SetResource() behavior

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@knottnt
Copy link
Contributor Author

knottnt commented Sep 16, 2025

new config field is used in this mq-controller PR to apply delta check to setting of spec fields based on update operation response

https://github.com/aws-controllers-k8s/mq-controller/blob/dd705d9ad7d04dc14c7ab6c9ad1d2d5a3e8dd6a6/pkg/resource/broker/sdk.go#L559

require.NotNil(crd)

expected := `
if delta.DifferentAt("Spec.AuthenticationStrategy") {
Copy link
Member

Choose a reason for hiding this comment

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

is this lambda comparing the latest after a ReadOne from AWS with desired from K8s? At first glance i don't think so

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the delta passed to sdkUpdate. So, it should be the a comparison of the desired and latest.

@knottnt
Copy link
Contributor Author

knottnt commented Sep 16, 2025

/test eks-controller-test

@knottnt knottnt requested a review from a-hilaly September 16, 2025 17:47
Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

👍

- Add config field only_set_unchanged_fields to UpdateOperationConfig.
- Add CRD.OnlySetChangedFieldsOnUpdate() func to check if only_set_unchanged_fields value
- Add logic in SetResource to add delta.DifferentAt() checks when only_set_unchanged_fields is set.
- Create unit test to verify new SetResource() behavior
@knottnt knottnt force-pushed the ignore-set-of-unchanged-fields branch from 6f57596 to 2104960 Compare September 25, 2025 03:51
@rushmash91
Copy link
Member

/retest

1 similar comment
@knottnt
Copy link
Contributor Author

knottnt commented Sep 26, 2025

/retest

@knottnt
Copy link
Contributor Author

knottnt commented Sep 26, 2025

/test ecr-controller-test

Copy link
Member

@rushmash91 rushmash91 left a comment

Choose a reason for hiding this comment

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

Thanks @knottnt !

@knottnt
Copy link
Contributor Author

knottnt commented Sep 26, 2025

/test ecr-controller-test

@knottnt
Copy link
Contributor Author

knottnt commented Sep 26, 2025

/hold

@ack-prow ack-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 26, 2025
@knottnt
Copy link
Contributor Author

knottnt commented Sep 26, 2025

/unhold

@ack-prow ack-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 26, 2025
@knottnt
Copy link
Contributor Author

knottnt commented Sep 26, 2025

/test s3-controller-test

@knottnt
Copy link
Contributor Author

knottnt commented Sep 26, 2025

/test eks-controller-test

@knottnt
Copy link
Contributor Author

knottnt commented Sep 26, 2025

/test ec2-controller-test

@knottnt
Copy link
Contributor Author

knottnt commented Sep 26, 2025

/test eks-controller-test

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

/lgtm

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

ack-prow bot commented Sep 29, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, knottnt

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

@a-hilaly
Copy link
Member

/retest

Copy link

ack-prow bot commented Sep 29, 2025

@knottnt: 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 a42910c link false /test verify-attribution
s3-olm-test a42910c link false /test s3-olm-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.

@knottnt
Copy link
Contributor Author

knottnt commented Sep 29, 2025

/test pipes-controller-test

@ack-prow ack-prow bot merged commit ef6e2f3 into aws-controllers-k8s:main Sep 29, 2025
17 of 19 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