Skip to content

Commit 402a01a

Browse files
committed
fix: fixing sync return format missing flag layer
Signed-off-by: Simon Schrottner <[email protected]>
1 parent 4d0169d commit 402a01a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

flagd/pkg/service/flag-sync/handler.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ func (s syncHandler) SyncFlags(req *syncv1.SyncFlagsRequest, server syncv1grpc.F
6363
return fmt.Errorf("error constructing metadata response")
6464
}
6565

66-
flagMap := s.convertMap(payload.Flags)
66+
flagConfig := map[string]interface{}{
67+
"flags": s.convertMap(payload.Flags),
68+
}
6769

68-
flags, err := json.Marshal(flagMap)
70+
flags, err := json.Marshal(flagConfig)
6971
if err != nil {
7072
s.log.Error(fmt.Sprintf("error retrieving flags from store: %v", err))
7173
return status.Error(codes.DataLoss, "error marshalling flags")
@@ -139,7 +141,11 @@ func (s syncHandler) FetchAllFlags(ctx context.Context, req *syncv1.FetchAllFlag
139141
return nil, status.Error(codes.Internal, "error retrieving flags from store")
140142
}
141143

142-
flagsString, err := json.Marshal(s.convertMap(flags))
144+
flagConfig := map[string]interface{}{
145+
"flags": s.convertMap(flags),
146+
}
147+
148+
flagsString, err := json.Marshal(flagConfig)
143149

144150
if err != nil {
145151
return nil, err

0 commit comments

Comments
 (0)