Skip to content

Commit

Permalink
remove old loadConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaasman00 committed Oct 3, 2024
1 parent 84defbe commit 512c72e
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions cmd/opampsupervisor/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/google/uuid"
"github.com/knadh/koanf/maps"
"github.com/knadh/koanf/parsers/yaml"
"github.com/knadh/koanf/providers/file"
"github.com/knadh/koanf/providers/rawbytes"
"github.com/knadh/koanf/v2"
"github.com/open-telemetry/opamp-go/client"
Expand Down Expand Up @@ -259,28 +258,6 @@ func (s *Supervisor) createTemplates() error {
return nil
}

func (s *Supervisor) loadConfig(configFile string) error {
if configFile == "" {
return errors.New("path to config file cannot be empty")
}

k := koanf.New("::")
if err := k.Load(file.Provider(configFile), yaml.Parser()); err != nil {
return err
}

decodeConf := koanf.UnmarshalConf{
Tag: "mapstructure",
}

s.config = config.DefaultSupervisor()
if err := k.UnmarshalWithConf("", &s.config, decodeConf); err != nil {
return fmt.Errorf("cannot parse %v: %w", configFile, err)
}

return nil
}

// getBootstrapInfo obtains the Collector's agent description by
// starting a Collector with a specific config that only starts
// an OpAMP extension, obtains the agent description, then
Expand Down

0 comments on commit 512c72e

Please sign in to comment.