Skip to content

Commit f565685

Browse files
authored
fix: tmp no strict bootstrap config parsing (#1232)
* no strict * codeowners
1 parent 60f7260 commit f565685

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
* @smartcontractkit/ccip-protocol
22
build/devenv @smartcontractkit/ccip-platform
33
deployment @smartcontractkit/ccip-platform
4+
bootstrap @smartcontractkit/ccip-platform

bootstrap/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ func LoadAndValidateConfig(path string, cfg *Config, needsInfra bool) error {
226226
if err != nil {
227227
return fmt.Errorf("failed to read config file: %w", err)
228228
}
229-
230-
err = parseTOMLStrict(string(tomlBytes), cfg)
229+
// TODO switch to strict mode once config migration is over
230+
err = parseTOML(string(tomlBytes), cfg, false)
231231
if err != nil {
232232
return fmt.Errorf("failed to parse config: %w", err)
233233
}
@@ -238,12 +238,12 @@ func LoadAndValidateConfig(path string, cfg *Config, needsInfra bool) error {
238238
return nil
239239
}
240240

241-
func parseTOMLStrict[T any](tomlString string, out T) error {
241+
func parseTOML[T any](tomlString string, out *T, strict bool) error {
242242
md, err := toml.Decode(tomlString, out)
243243
if err != nil {
244244
return fmt.Errorf("failed to decode toml: %w", err)
245245
}
246-
if len(md.Undecoded()) > 0 {
246+
if strict && len(md.Undecoded()) > 0 {
247247
return fmt.Errorf("strict decode failed, found undecoded fields: %+v", md.Undecoded())
248248
}
249249
return nil

0 commit comments

Comments
 (0)