@@ -52,51 +52,10 @@ func (d *resourceDescriptor) ResourceFromRuntimeObject(
5252 }
5353}
5454
55- // Equal returns true if the two supplied AWSResources have the same content.
56- // The underlying types of the two supplied AWSResources should be the same. In
57- // other words, the Equal() method should be called with the same concrete
58- // implementing AWSResource type
59- func (d *resourceDescriptor) Equal(
60- a acktypes.AWSResource,
61- b acktypes.AWSResource,
62- ) bool {
63- ac := a.(*resource)
64- bc := b.(*resource)
65- opts := []cmp.Option{cmpopts.EquateEmpty()}
66- { {- if .CRD.CompareIgnoredFields } }
67- opts = append(opts, cmpopts.IgnoreFields(*ac.ko,
68- { {- range $fieldPath := .CRD.CompareIgnoredFields } }
69- { { printf " %q" $fieldPath } },
70- { {- end } }
71- ))
72- { {- end } }
73- return cmp.Equal(ac.ko, bc.ko, opts...)
74- }
75-
76- // Diff returns a Reporter which provides the difference between two supplied
77- // AWSResources. The underlying types of the two supplied AWSResources should
78- // be the same. In other words, the Diff() method should be called with the
79- // same concrete implementing AWSResource type
80- func (d *resourceDescriptor) Diff(
81- a acktypes.AWSResource,
82- b acktypes.AWSResource,
83- ) *ackcompare.Reporter {
84- ac := a.(*resource)
85- bc := b.(*resource)
86- var diffReporter ackcompare.Reporter
87- opts := []cmp.Option{
88- cmp.Reporter(&diffReporter),
89- cmp.AllowUnexported(svcapitypes.{{ .CRD.Kind } }{ } ),
90- }
91- { {- if .CRD.CompareIgnoredFields } }
92- opts = append(opts, cmpopts.IgnoreFields(*ac.ko,
93- { {- range $fieldPath := .CRD.CompareIgnoredFields } }
94- { { printf " %q" $fieldPath } },
95- { {- end } }
96- ))
97- { {- end } }
98- cmp.Equal(ac.ko, bc.ko, opts...)
99- return &diffReporter
55+ // Delta returns an `ackcompare.Delta` object containing the difference between
56+ // one `AWSResource` and another.
57+ func (d *resourceDescriptor) Delta(a, b acktypes.AWSResource) *ackcompare.Delta {
58+ return newResourceDelta(a, b)
10059}
10160
10261// UpdateCRStatus accepts an AWSResource object and changes the Status
0 commit comments