From 431125c309fa947659422e7b764e9c6dacdebd7e Mon Sep 17 00:00:00 2001 From: Joyce Ma Date: Tue, 17 Dec 2024 03:33:10 +0000 Subject: [PATCH] Fix updates in mockalloydb --- mockgcp/mockalloydb/instance.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mockgcp/mockalloydb/instance.go b/mockgcp/mockalloydb/instance.go index a79654d8e0..990c5e3780 100644 --- a/mockgcp/mockalloydb/instance.go +++ b/mockgcp/mockalloydb/instance.go @@ -17,6 +17,7 @@ package mockalloydb import ( "context" "fmt" + "strings" "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc/codes" @@ -188,7 +189,8 @@ func (s *AlloyDBAdminV1) UpdateInstance(ctx context.Context, req *pb.UpdateInsta // TODO: Some sort of helper for fieldmask? for _, path := range paths { - switch path { + topLevelField := strings.Split(path, ".")[0] + switch topLevelField { case "labels": obj.Labels = req.Instance.GetLabels() case "annotations":