Skip to content

Fix cluster logging config comparison to prevent false deltas#202

Open
a-hilaly wants to merge 1 commit intoaws-controllers-k8s:mainfrom
a-hilaly:fix/logging-config
Open

Fix cluster logging config comparison to prevent false deltas#202
a-hilaly wants to merge 1 commit intoaws-controllers-k8s:mainfrom
a-hilaly:fix/logging-config

Conversation

@a-hilaly
Copy link
Member

The EKS API always returns both enabled and disabled log type entries
in its response, but users typically only specify enabled log types
in their manifests. The generated structural delta comparison treated
this representation mismatch as a real diff, causing the controller
to repeatedly attempt no-op logging updates. This blocked all other
updates (including version upgrades) from being processed, since the
logging handler always returned early.

Disable the generated delta for the Logging field and replace it with
a custom semantic comparison in customPreCompare that only compares
the effective set of enabled log types using SliceStringPEqual.

When a real logging change is detected, send the full 5-type config
(both enabled and disabled) to the UpdateClusterConfig API to avoid
InvalidParameterException "No changes needed" errors.

Also remove the LoggingNoChangesError swallow logic that was masking
the root cause, and clean up the now unused generated newLogging
helper from sdk.go and its template.

Fixes aws-controllers-k8s/community#2781

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 February 24, 2026 04:37
@ack-prow
Copy link

ack-prow bot commented Feb 24, 2026

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described 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

@ack-prow ack-prow bot added the approved label Feb 24, 2026
The EKS API always returns both enabled and disabled log type entries
in its response, but users typically only specify enabled log types
in their manifests. The generated structural delta comparison treated
this representation mismatch as a real diff, causing the controller
to repeatedly attempt no-op logging updates. This blocked all other
updates (including version upgrades) from being processed, since the
logging handler always returned early.

Disable the generated delta for the Logging field and replace it with
a custom semantic comparison in `customPreCompare` that only compares
the effective set of enabled log types using `SliceStringPEqual`.

When a real logging change is detected, send the full 5-type config
(both enabled and disabled) to the `UpdateClusterConfig` API to avoid
`InvalidParameterException` "No changes needed" errors.

Also remove the `LoggingNoChangesError` swallow logic that was masking
the root cause, and clean up the now unused generated newLogging
helper from `sdk.go` and its template.

Fixes aws-controllers-k8s/community#2781
@a-hilaly
Copy link
Member Author

/retest

2 similar comments
@a-hilaly
Copy link
Member Author

/retest

@a-hilaly
Copy link
Member Author

/retest

@ack-prow
Copy link

ack-prow bot commented Feb 25, 2026

@a-hilaly: 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
eks-verify-code-gen 34f64d1 link true /test eks-verify-code-gen

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

}
}

// Disabled types: known EKS log types that the user did not enable.
Copy link
Contributor

Choose a reason for hiding this comment

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

What about logs the user explicitly disabled? If EKS add a new LogType that isn't listed here this will prevent the user from disabling it if it ever became enabled.

Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of using a hardcoded list could we use the values from latest to get the most recent list of LogTypes? The full set of log types to disable would be (latest disabled - user enable + user disabled).

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.

EKS Version Upgrade not triggered when updating clusterVersion via ACK

2 participants