Skip to content

Commit df46566

Browse files
authored
Set synced when missing (#68)
Issue #, if available: aws-controllers-k8s/community#1133 Description of changes: * Do not overwrite `ACK.ResourceSynced` condition, if it was being set by ReadOne/Create/Update hook code * This change will restore existing functionality for asynchronous Create/Update handling until `AWS.ResourceManager.IsSynced` method is implemented. * revert the AWSResourceManager.IsSynced method, which can be added after this immediate patch ---- Tested locally with `iam-controller` and `rds-controller` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent f142275 commit df46566

File tree

3 files changed

+5
-25
lines changed

3 files changed

+5
-25
lines changed

mocks/pkg/types/aws_resource_manager.go

Lines changed: 0 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/runtime/reconciler.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,12 @@ func (r *resourceReconciler) updateResource(
424424
}
425425
rlog.Info("updated resource")
426426
} else {
427-
// If there is no delta between desired state and latest state, it is
427+
// If there is no delta between desired state and latest state, and
428+
// ACK.ResourceSynced condition is not already set, it is
428429
// safe to set ACK.ResourceSynced condition to true.
429-
ackcondition.SetSynced(latest, corev1.ConditionTrue, nil, nil)
430+
if ackcondition.Synced(latest) == nil {
431+
ackcondition.SetSynced(latest, corev1.ConditionTrue, nil, nil)
432+
}
430433
}
431434
return latest, nil
432435
}

pkg/types/aws_resource_manager.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ type AWSResourceManager interface {
8383
// This method also adds/updates the ConditionTypeReferencesResolved for the
8484
// AWSResource.
8585
ResolveReferences(context.Context, client.Reader, AWSResource) (AWSResource, error)
86-
// IsSynced returns true if a resource is synced.
87-
IsSynced(context.Context, AWSResource) (bool, error)
8886
}
8987

9088
// AWSResourceManagerFactory returns an AWSResourceManager that can be used to

0 commit comments

Comments
 (0)