Skip to content

Commit

Permalink
Fleetspeak/Configs: Do not crash when reading unknown field names
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 673835911
  • Loading branch information
gnoack authored and copybara-github committed Sep 12, 2024
1 parent 77bf103 commit f0d649c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ func (h *FilesystemPersistenceHandler) ReadServices() ([]*fspb.ClientServiceConf
}

s := &fspb.ClientServiceConfig{}
if err := prototext.Unmarshal(b, s); err != nil {
err = prototext.UnmarshalOptions{
// Forward compatibility with future field names
DiscardUnknown: true,
}.Unmarshal(b, s)
if err != nil {
log.Errorf("Unable to parse service file [%s], ignoring: %v", fp, err)
continue
}
Expand Down

0 comments on commit f0d649c

Please sign in to comment.