@@ -104,13 +104,14 @@ func (e *external) Observe(ctx context.Context, mg cpresource.Managed) (managed.
104
104
}
105
105
Generate{ { .CRD.Names.Camel } }(resp).Status.AtProvider.DeepCopyInto(&cr.Status.AtProvider)
106
106
107
- upToDate, err := e.isUpToDate(cr, resp)
107
+ upToDate, diff, err := e.isUpToDate(ctx, cr, resp)
108
108
if err != nil {
109
109
return managed.ExternalObservation{} , errors.Wrap(err, "isUpToDate check failed")
110
110
}
111
111
return e.postObserve(ctx, cr, resp, managed.ExternalObservation{
112
112
ResourceExists: true ,
113
113
ResourceUpToDate: upToDate,
114
+ Diff: diff,
114
115
ResourceLateInitialized: ! cmp.Equal(&cr.Spec.ForProvider, currentSpec),
115
116
} , nil)
116
117
{ {- else } }
@@ -228,18 +229,18 @@ type external struct {
228
229
preObserve func(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadOne.InputRef.Shape.ShapeName } }) error
229
230
postObserve func(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadOne.OutputRef.Shape.ShapeName } }, managed.ExternalObservation, error) (managed.ExternalObservation, error)
230
231
lateInitialize func(*svcapitypes.{ { .CRD.Names.Camel } }Parameters, *svcsdk.{ { .CRD.Ops.ReadOne.OutputRef.Shape.ShapeName } }) error
231
- isUpToDate func(*svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadOne.OutputRef.Shape.ShapeName } }) (bool, error)
232
+ isUpToDate func(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadOne.OutputRef.Shape.ShapeName } }) (bool, string , error)
232
233
{ {- else if .CRD.Ops.GetAttributes } }
233
234
preObserve func(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.GetAttributes.InputRef.Shape.ShapeName } }) error
234
235
postObserve func(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.GetAttributes.OutputRef.Shape.ShapeName } }, managed.ExternalObservation, error) (managed.ExternalObservation, error)
235
236
lateInitialize func(*svcapitypes.{ { .CRD.Names.Camel } }Parameters, *svcsdk.{ { .CRD.Ops.GetAttributes.OutputRef.Shape.ShapeName } }) error
236
- isUpToDate func(*svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.GetAttributes.OutputRef.Shape.ShapeName } }) (bool, error)
237
+ isUpToDate func(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.GetAttributes.OutputRef.Shape.ShapeName } }) (bool, string , error)
237
238
{ {- else if .CRD.Ops.ReadMany } }
238
239
preObserve func(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadMany.InputRef.Shape.ShapeName } }) error
239
240
postObserve func(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadMany.OutputRef.Shape.ShapeName } }, managed.ExternalObservation, error) (managed.ExternalObservation, error)
240
241
filterList func(*svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadMany.OutputRef.Shape.ShapeName } }) *svcsdk.{ { .CRD.Ops.ReadMany.OutputRef.Shape.ShapeName } }
241
242
lateInitialize func(*svcapitypes.{ { .CRD.Names.Camel } }Parameters, *svcsdk.{ { .CRD.Ops.ReadMany.OutputRef.Shape.ShapeName } }) error
242
- isUpToDate func(*svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadMany.OutputRef.Shape.ShapeName } }) (bool, error)
243
+ isUpToDate func(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadMany.OutputRef.Shape.ShapeName } }) (bool, string , error)
243
244
{ {- else } }
244
245
observe func(context.Context, cpresource.Managed) (managed.ExternalObservation, error)
245
246
{ {- end } }
@@ -270,8 +271,8 @@ func nopPostObserve(_ context.Context, _ *svcapitypes.{{ .CRD.Names.Camel }}, _
270
271
func nopLateInitialize(*svcapitypes.{ { .CRD.Names.Camel } }Parameters, *svcsdk.{ { .CRD.Ops.ReadOne.OutputRef.Shape.ShapeName } }) error {
271
272
return nil
272
273
}
273
- func alwaysUpToDate(*svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadOne.OutputRef.Shape.ShapeName } }) (bool, error) {
274
- return true , nil
274
+ func alwaysUpToDate(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadOne.OutputRef.Shape.ShapeName } }) (bool, string , error) {
275
+ return true , " " , nil
275
276
}
276
277
{ {- else if .CRD.Ops.GetAttributes } }
277
278
func nopPreObserve(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.GetAttributes.InputRef.Shape.ShapeName } }) error {
@@ -284,8 +285,8 @@ func nopPostObserve(_ context.Context, _ *svcapitypes.{{ .CRD.Names.Camel }}, _
284
285
func nopLateInitialize(*svcapitypes.{ { .CRD.Names.Camel } }Parameters, *svcsdk.{ { .CRD.Ops.GetAttributes.OutputRef.Shape.ShapeName } }) error {
285
286
return nil
286
287
}
287
- func alwaysUpToDate(*svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.GetAttributes.OutputRef.Shape.ShapeName } }) (bool, error) {
288
- return true , nil
288
+ func alwaysUpToDate(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.GetAttributes.OutputRef.Shape.ShapeName } }) (bool, string , error) {
289
+ return true , " " , nil
289
290
}
290
291
{ {- else if .CRD.Ops.ReadMany } }
291
292
func nopPreObserve(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadMany.InputRef.Shape.ShapeName } }) error {
@@ -301,8 +302,8 @@ func nopFilterList(_ *svcapitypes.{{ .CRD.Names.Camel }}, list *svcsdk.{{ .CRD.O
301
302
func nopLateInitialize(*svcapitypes.{ { .CRD.Names.Camel } }Parameters, *svcsdk.{ { .CRD.Ops.ReadMany.OutputRef.Shape.ShapeName } }) error {
302
303
return nil
303
304
}
304
- func alwaysUpToDate(*svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadMany.OutputRef.Shape.ShapeName } }) (bool, error) {
305
- return true , nil
305
+ func alwaysUpToDate(context.Context, *svcapitypes.{ { .CRD.Names.Camel } }, *svcsdk.{ { .CRD.Ops.ReadMany.OutputRef.Shape.ShapeName } }) (bool, string , error) {
306
+ return true , " " , nil
306
307
}
307
308
{ { else } }
308
309
func nopObserve(context.Context, cpresource.Managed) (managed.ExternalObservation, error) {
0 commit comments