Skip to content

Commit 47771f1

Browse files
committed
Add structured reporting diff to SecretManagerSecret
1 parent 140e11a commit 47771f1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/controller/direct/secretmanager/secret_controller.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/directbase"
3333
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/controller/direct/registry"
3434
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/label"
35+
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/structuredreporting"
3536
"google.golang.org/api/option"
3637
"google.golang.org/protobuf/types/known/fieldmaskpb"
3738
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -291,6 +292,12 @@ func (a *Adapter) Update(ctx context.Context, op *directbase.UpdateOperation) er
291292
return nil
292293
}
293294

295+
report := &structuredreporting.Diff{Object: op.GetUnstructured()}
296+
for path := range paths {
297+
report.AddField(path, nil, nil)
298+
}
299+
structuredreporting.ReportDiff(ctx, report)
300+
294301
req := &secretmanagerpb.UpdateSecretRequest{
295302
UpdateMask: &fieldmaskpb.FieldMask{Paths: sets.List(paths)},
296303
Secret: resource,

0 commit comments

Comments
 (0)