Repository navigation
fix: compare ReplicationGroup log delivery with the observed state instead of an annotation - #242
Conversation
…stead of an annotation modifyDelta compared the desired log delivery requests with the last request stored in an annotation, so an adopted resource, which never carried it, re-sent the same configuration on every reconcile. The comparison now uses status.logDeliveryConfigurations and the pending values. Signed-off-by: Youssef Omar Bouden <youssef.bouden2002@gmail.com>
|
Hi @blacksoxx. Thanks for your PR. I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
gobos12
left a comment
There was a problem hiding this comment.
Hi @blacksoxx, thanks for the contribution! I ran this PR against a live cluster and confirmed it fixes aws-controllers-k8s/community#3024: an adopted ReplicationGroup with no annotation no longer re-sends log delivery configurations, and changing, disabling and re-enabling each produced exactly one ModifyReplicationGroup.
I noticed you mentioned the existing suite has no log delivery case and you couldn't add one against a live account. We used to have a test_rg_log_delivery case that was removed in #151, and service_bootstrap.py still provisions two CloudWatch log groups for it (LOG_GROUP/LOG_GROUP_2). I'd suggest restoring a version of that so we can properly test this e2e. The PR's e2e job would run it against the test account so you don't need your own, and I'll tag this PR ok-to-test so they run when you update the PR. Thanks!
|
/ok-to-test |
Adds slow-log delivery to a CloudWatch log group, moves it to the second bootstrap group with another format, checks a resync leaves it alone, disables it and enables it again, asserting the CR status and the AWS side each time. Signed-off-by: Youssef Omar Bouden <youssef.bouden2002@gmail.com>
|
Thanks @gobos12 for the live confirmation and the pointer to the old test. 1ce7da1 brings back a |
The shared manifest substitutes engineVersion unquoted, so 7.1 was parsed as a number and the API server rejected the CR with a 422. 6.x, as the creation test uses, keeps slow-log support and parses as a string. Signed-off-by: Youssef Omar Bouden <youssef.bouden2002@gmail.com>
|
The e2e run on 1ce7da1 failed before the test started: the shared |
|
Thanks @blacksoxx, and thanks for restoring the e2e. I went through the change and the e2e run on 748073a. The controller log for the Needs a rebase: #243 landed and also creates A few non-blocking points:
|
…og-delivery-observed # Conflicts: # pkg/resource/replication_group/hooks_test.go # test/e2e/tests/test_replicationgroup.py
…n, clean up the e2e group A request that leaves destinationType, logFormat or destinationDetails unset no longer re-sends on every reconcile because the API filled them in. setAnnotationsFields removes the last-requested-log-delivery-configurations annotation that older controllers wrote. The log delivery e2e deletes its group in a finally block like the durability tests. Signed-off-by: Youssef Omar Bouden <youssef.bouden2002@gmail.com>
|
Thanks @gustavodiaz7722 for going through the controller log, the per-patch Main is merged in (0f16608, a merge rather than a rebase so the reviewed commits stay put; both sets of tests kept in
|
|
/LGTM |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: blacksoxx, gustavodiaz7722 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/label release/patch |
…into feat/1048-global-replication-group
Issue #, if available: aws-controllers-k8s/community#3024
Description of changes:
modifyDeltacomparedspec.logDeliveryConfigurationswith the last request the controller had stored in thelast-requested-log-delivery-configurationsannotation, never with what the API reports. A resource that was adopted, or whose annotation was dropped by whatever applies its manifest, has no such annotation, so the comparison failed on every reconcile andModifyReplicationGroupre-sent the same configuration each time, giving thedesired resource state has changedandupdated resourcepair in the issue. TheLogDeliveryConfigurationsline in the diff on community#2711 is the same thing.The comparison now runs against the observed state. A desired request is satisfied when
status.logDeliveryConfigurationsholds an entry for its log type with the same destination type, format and destination that is not being disabled, or whenstatus.pendingModifiedValues.logDeliveryConfigurationsholds that entry because a change is still in flight. A request withenabled: falseis satisfied when no such entry exists or the entry is disabling. An entry inerrorwith the right destination is left alone rather than re-requested every 30 seconds; changing the destination in the spec still re-requests it. A request without a log type is sent so the API rejects it with a terminal error, as before. The annotation and the two helpers that wrote and read it are removed since nothing reads them any more; stale annotations on existing resources are harmless.Tests:
TestLogDeliveryRequiresUpdate(14 rows, including the adopted case from the issue, a pending change, enabling, disabling, error and a Kinesis destination) andTestModifyDeltaLogDeliveryIgnoresAnnotation, which runs the generated delta without the annotation and fails on main.go build ./...andgo test ./pkg/...pass;go veton the package reports the same pre-existing unkeyedmetav1.Timeliterals in the generatedsdk.goas main. No e2e run: the existing suite has no log delivery case and I could not add one against a live account.The e2e
test_rg_log_deliveryadds slow-log delivery to a CloudWatch log group, moves it to the second bootstrap group with another format, checks a resync leaves it alone, disables it and enables it again, asserting the CR status and the AWS side each time.A request that leaves
destinationType,logFormatordestinationDetailsunset accepts what the API reports for them instead of re-sending.setAnnotationsFieldsremoves thelast-requested-log-delivery-configurationsannotation that earlier controllers wrote. The log delivery e2e cleans up its group in afinallyblock.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.