Skip to content

Commit 991c19b

Browse files
committed
Add structured reporting diff to AlloyDBInstance
1 parent 140e11a commit 991c19b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/controller/direct/alloydb/instance_controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/directbase"
2828
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/registry"
2929
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/label"
30+
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/structuredreporting"
3031

3132
gcp "cloud.google.com/go/alloydb/apiv1beta"
3233
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
@@ -298,6 +299,13 @@ func (a *instanceAdapter) Update(ctx context.Context, updateOp *directbase.Updat
298299
}
299300
return nil
300301
}
302+
303+
report := &structuredreporting.Diff{Object: updateOp.GetUnstructured()}
304+
for _, path := range updatePaths {
305+
report.AddField(path, nil, nil)
306+
}
307+
structuredreporting.ReportDiff(ctx, report)
308+
301309
updateMask := &fieldmaskpb.FieldMask{
302310
Paths: updatePaths,
303311
}

0 commit comments

Comments
 (0)