Skip to content

feat: filter ignore-field-drift differences from generated resource delta#714

Open
sapphirew wants to merge 1 commit into
aws-controllers-k8s:mainfrom
sapphirew:ignore-fields-delta-filter
Open

feat: filter ignore-field-drift differences from generated resource delta#714
sapphirew wants to merge 1 commit into
aws-controllers-k8s:mainfrom
sapphirew:ignore-fields-delta-filter

Conversation

@sapphirew

@sapphirew sapphirew commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Description

Wires the runtime's selective field reconciliation feature into the generated per-resource delta. After the existing delta_post_compare hook (and before return delta), the generated newResourceDelta now calls ackrt.FilterIgnoredDeltaDifferences(delta, a, featuregate.GetGlobalFeatureGates()).

This ensures that when the SelectiveReconciliation feature gate is enabled and a resource carries the services.k8s.aws/ignore-field-drift annotation, differences under an ignored field path are removed from the computed delta. As a result, every consumer of the generated delta — including the requeue / IsSynced path, not just the update path — treats drift on those fields as ignored, consistent with the runtime behavior.

The call is gated and a no-op when the feature is disabled, so existing controllers are unaffected until an operator opts in. The only change is one template (templates/pkg/resource/delta.go.tpl); controllers pick it up on their next code-generation + runtime bump. There are no CRD changes.

Dependency / ordering

⚠️ Depends on the companion ACK runtime change that adds FilterIgnoredDeltaDifferences and the process-wide feature-gate accessors. Regenerated delta.go will not compile until that runtime change is merged and released, and this PR's runtime pin is bumped to that release. Do not merge until the runtime change is merged and released.

Testing

Regenerated the iam-controller with this template against the companion runtime: the generated pkg/resource/role/delta.go contains the FilterIgnoredDeltaDifferences call and the controller compiles. The feature was then verified end-to-end on a live account (external tag survives reconciliation; resource stays Synced).

Refs aws-controllers-k8s/community#2367

@sapphirew

Copy link
Copy Markdown
Contributor Author

Companion runtime PR (must merge + release first): aws-controllers-k8s/runtime#256 — it adds FilterIgnoredDeltaDifferences and the process-wide feature-gate accessors that this template change calls.

@knottnt

knottnt commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

/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 Jun 23, 2026
…delta

Adds a call to ackrt.FilterIgnoredDeltaDifferences in the generated
newResourceDelta so that, when the SelectiveReconciliation feature gate is
enabled and a resource carries the services.k8s.aws/ignore-field-drift
annotation, differences under an ignored field path are removed from the
computed delta. This ensures every consumer of the generated delta --
including the requeue / IsSynced path -- treats those fields' drift as
ignored, matching the runtime behavior in updateResource.

The call is gated and a no-op when the feature is disabled, so existing
controllers are unaffected until they opt in.

Refs aws-controllers-k8s/community#2367
@sapphirew sapphirew force-pushed the ignore-fields-delta-filter branch from d5937d5 to 0204373 Compare June 29, 2026 19:34
@ack-prow

ack-prow Bot commented Jun 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sapphirew
Once this PR has been reviewed and has the lgtm label, please assign knottnt 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

@sapphirew sapphirew changed the title feat: filter ignored-field differences from generated resource delta feat: filter ignore-field-drift differences from generated resource delta Jun 29, 2026
@sapphirew

Copy link
Copy Markdown
Contributor Author

Updated to ignore-field-drift. Companion runtime PR (must merge + release first): aws-controllers-k8s/runtime#256 — it provides FilterIgnoredDeltaDifferences and the process-wide feature-gate accessors this template change calls.

@ack-prow

ack-prow Bot commented Jun 29, 2026

Copy link
Copy Markdown

@sapphirew: 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
cloudfront-controller-test 0204373 link true /test cloudfront-controller-test
dynamodb-controller-test 0204373 link true /test dynamodb-controller-test
ecr-controller-test 0204373 link true /test ecr-controller-test
apigatewayv2-controller-test 0204373 link true /test apigatewayv2-controller-test
iam-controller-test 0204373 link true /test iam-controller-test
eventbridge-controller-test 0204373 link true /test eventbridge-controller-test
s3-controller-test 0204373 link true /test s3-controller-test
pipes-controller-test 0204373 link true /test pipes-controller-test
prometheusservice-controller-test 0204373 link true /test prometheusservice-controller-test
efs-controller-test 0204373 link true /test efs-controller-test
documentdb-controller-test 0204373 link true /test documentdb-controller-test
eks-controller-test 0204373 link true /test eks-controller-test
acm-controller-test 0204373 link true /test acm-controller-test
ec2-controller-test 0204373 link true /test ec2-controller-test
lambda-controller-test 0204373 link true /test lambda-controller-test

Full PR test history. Your PR dashboard.

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

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants