Skip to content

Commit 21bb874

Browse files
committed
remove unused AWSResourceDescriptor.UpdateCRStatus
Originally, I'd planned to use the AWSResourceDescriptor.UpdateCRStatus interface method to allow different resources to override the way they set conditions and such. However, other places like the generator config's use of terminal conditions, generic hook points and custom override places became the canonical ways of extending this behaviour. So, the AWSResourceDescriptor.UpdateCRStatus interface method is just an anachronism at this point and needs to be removed since it's just noise and always just returns true.
1 parent 055b089 commit 21bb874

File tree

4 files changed

+0
-35
lines changed

4 files changed

+0
-35
lines changed

mocks/pkg/types/aws_resource_descriptor.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: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,6 @@ func (r *resourceReconciler) patchResourceStatus(
369369
exit := rlog.Trace("r.patchResourceStatus")
370370
defer exit(err)
371371

372-
changedStatus, err := r.rd.UpdateCRStatus(latest)
373-
if err != nil {
374-
return err
375-
}
376-
if !changedStatus {
377-
return nil
378-
}
379372
rlog.Enter("kc.Patch (status)")
380373
// It is necessary to use `DeepCopyObject` versions of `latest` when calling
381374
// `Patch` as this method overrides all values as merged from `desired`.

pkg/runtime/reconciler_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ func TestReconcilerUpdate(t *testing.T) {
103103
delta,
104104
).Once()
105105
rd.On("Delta", desired, latest).Return(ackcompare.NewDelta())
106-
rd.On("UpdateCRStatus", latest).Return(true, nil)
107106
rd.On("IsManaged", desired).Return(true)
108107

109108
rm := &ackmocks.AWSResourceManager{}
@@ -221,7 +220,6 @@ func TestReconcilerUpdate_PatchMetadataAndSpec_DiffInMetadata(t *testing.T) {
221220
delta,
222221
).Once()
223222
rd.On("Delta", desired, latest).Return(ackcompare.NewDelta())
224-
rd.On("UpdateCRStatus", latest).Return(true, nil)
225223
rd.On("IsManaged", desired).Return(true)
226224

227225
rm := &ackmocks.AWSResourceManager{}
@@ -338,7 +336,6 @@ func TestReconcilerUpdate_PatchMetadataAndSpec_DiffInSpec(t *testing.T) {
338336
rd.On("Delta", desired, latest).Return(
339337
delta,
340338
)
341-
rd.On("UpdateCRStatus", latest).Return(true, nil)
342339
rd.On("IsManaged", desired).Return(true)
343340

344341
rm := &ackmocks.AWSResourceManager{}

pkg/types/aws_resource_descriptor.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ type AWSResourceDescriptor interface {
3737
// Delta returns an `ackcompare.Delta` object containing the difference between
3838
// one `AWSResource` and another.
3939
Delta(a, b AWSResource) *ackcompare.Delta
40-
// UpdateCRStatus accepts an AWSResource object and changes the Status
41-
// sub-object of the AWSResource's Kubernetes custom resource (CR) and
42-
// returns whether any changes were made
43-
UpdateCRStatus(AWSResource) (bool, error)
4440
// IsManaged returns true if the supplied AWSResource is under the
4541
// management of an ACK service controller. What this means in practice is
4642
// that the underlying custom resource (CR) in the AWSResource has had a

0 commit comments

Comments
 (0)