From d75b3db69b2124171b50b9a5f12f6135f2818cfe Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Wed, 4 Dec 2024 20:43:31 +0000 Subject: [PATCH] real->mock --- pkg/controller/direct/secretmanager/secret_controller.go | 3 +-- pkg/controller/direct/secretmanager/secret_mapping.go | 2 +- .../secretmanager/v1beta1/fullsecretmanagersecret/_http.log | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/controller/direct/secretmanager/secret_controller.go b/pkg/controller/direct/secretmanager/secret_controller.go index fff0bbe736..aecfc7731c 100644 --- a/pkg/controller/direct/secretmanager/secret_controller.go +++ b/pkg/controller/direct/secretmanager/secret_controller.go @@ -204,8 +204,7 @@ func (a *Adapter) Create(ctx context.Context, op *directbase.CreateOperation) er external := a.id.String() status.ExternalRef = &external status.Name = created.Name - err = op.UpdateStatus(ctx, status, nil) - if err != nil { + if err = op.UpdateStatus(ctx, status, nil); err != nil { return err } // VersionAliases cannot be set in Creation, requeing the result to update the versionAlias without waiting for the reconciliation interval. diff --git a/pkg/controller/direct/secretmanager/secret_mapping.go b/pkg/controller/direct/secretmanager/secret_mapping.go index edb775f73f..c96dd24cfa 100644 --- a/pkg/controller/direct/secretmanager/secret_mapping.go +++ b/pkg/controller/direct/secretmanager/secret_mapping.go @@ -134,7 +134,7 @@ func MapStringString_ToMapStringInt64(mapCtx *direct.MapContext, in map[string]s for k, v := range in { stringV, err := strconv.ParseInt(v, 10, 64) if err != nil { - mapCtx.Errorf("%s has invalid vale, expect int64, got %s", k, v) + mapCtx.Errorf("%s has invalid value, expect int64, got %s", k, v) } out[k] = stringV } diff --git a/pkg/test/resourcefixture/testdata/basic/secretmanager/v1beta1/fullsecretmanagersecret/_http.log b/pkg/test/resourcefixture/testdata/basic/secretmanager/v1beta1/fullsecretmanagersecret/_http.log index 0b2954bc15..a1d0b8bdba 100644 --- a/pkg/test/resourcefixture/testdata/basic/secretmanager/v1beta1/fullsecretmanagersecret/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/secretmanager/v1beta1/fullsecretmanagersecret/_http.log @@ -349,6 +349,7 @@ Content-Type: application/json User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager 200 OK +Cache-Control: private Content-Type: application/json; charset=UTF-8 Server: ESF Vary: Origin @@ -362,7 +363,7 @@ X-Xss-Protection: 0 "done": true, "name": "operations/${operationID}", "response": { - "@type": "type.googleapis.com/google.api.serviceusage.v1beta1.ServiceIdentity", + "@type": "type.googleapis.com/mockgcp.api.serviceusage.v1beta1.ServiceIdentity", "email": "service-${projectNumber}@gcp-sa-secretmanager.iam.gserviceaccount.com", "uniqueId": "12345678" }