diff --git a/pkg/config/binder/binder.go b/pkg/config/binder/binder.go index e59b210318..7345d05e26 100644 --- a/pkg/config/binder/binder.go +++ b/pkg/config/binder/binder.go @@ -1,5 +1,4 @@ -// Package binder binds OpenCloud yaml config files to config structs, as a leaf -// package that avoids importing the aggregate service config in pkg/config. +// Package binder binds yaml config files to config structs. package binder import ( @@ -42,8 +41,6 @@ func BindSourcesToStructsFS(fileSystem fs.FS, filePath, service string, dst any) return err } - // the error is ignored on purpose, matching the pre-extraction behavior: - // an unparseable yaml file binds nothing instead of failing the startup _ = cnf.LoadSources("yaml", yamlContent) err = cnf.BindStruct("", &dst) diff --git a/pkg/config/binder/binder_test.go b/pkg/config/binder/binder_test.go index 07f76bc577..195aa04b67 100644 --- a/pkg/config/binder/binder_test.go +++ b/pkg/config/binder/binder_test.go @@ -14,8 +14,7 @@ type TestConfig struct { } func TestBindSourcesToStructs(t *testing.T) { - // setup test env: one var set to pin env expansion, two deliberately - // unset to pin the defaults + // setup test env t.Setenv("BINDER_TEST_SET_VAR", "from-env") yaml := ` a: "${BINDER_TEST_SET_VAR|no-foo}" diff --git a/pkg/config/helpers.go b/pkg/config/helpers.go index 576ecab5ee..a910534838 100644 --- a/pkg/config/helpers.go +++ b/pkg/config/helpers.go @@ -7,7 +7,6 @@ import ( ) // BindSourcesToStructs assigns any config value from a config file / env variable to struct `dst`. -// The implementation lives in pkg/config/binder. func BindSourcesToStructs(service string, dst any) error { return binder.BindSourcesToStructs(service, dst) }