@@ -26,6 +26,7 @@ import (
2626 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/directbase"
2727 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/registry"
2828 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/fuzztesting"
29+ "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/structuredreporting"
2930
3031 gcp "cloud.google.com/go/workstations/apiv1"
3132 pb "cloud.google.com/go/workstations/apiv1/workstationspb"
@@ -251,18 +252,24 @@ func (a *Adapter) Update(ctx context.Context, updateOp *directbase.UpdateOperati
251252 }
252253 resource .Name = a .id .FullyQualifiedName ()
253254
255+ report := & structuredreporting.Diff {Object : updateOp .GetUnstructured ()}
256+
254257 updateMask := & fieldmaskpb.FieldMask {}
255258 if ! reflect .DeepEqual (resource .Annotations , a .actual .Annotations ) {
259+ report .AddField ("annotations" , a .actual .Annotations , resource .Annotations )
256260 updateMask .Paths = append (updateMask .Paths , "annotations" )
257261 }
258262 if ! reflect .DeepEqual (resource .Labels , a .actual .Labels ) {
263+ report .AddField ("labels" , a .actual .Labels , resource .Labels )
259264 updateMask .Paths = append (updateMask .Paths , "labels" )
260265 }
261266
262267 if len (updateMask .Paths ) == 0 {
263268 return nil
264269 }
265270
271+ structuredreporting .ReportDiff (ctx , report )
272+
266273 req := & pb.UpdateWorkstationClusterRequest {
267274 UpdateMask : updateMask ,
268275 WorkstationCluster : resource ,
0 commit comments