Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
yurishkuro committed Dec 12, 2024
1 parent 4569ab2 commit 8720eb8
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions cmd/internal/flags/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,13 @@ func (s *AdminServer) AddFlags(flagSet *flag.FlagSet) {
func (s *AdminServer) initFromViper(v *viper.Viper, logger *zap.Logger) error {
s.setLogger(logger)

s.serverCfg.Endpoint = v.GetString(adminHTTPHostPort)
tlsAdminHTTP, err := tlsAdminHTTPFlagsConfig.InitFromViper(v)
if err != nil {
return fmt.Errorf("failed to parse admin server TLS options: %w", err)
}
tlsAdminHTTPConfig := tlsAdminHTTP.ToOtelServerConfig()
if tlsAdminHTTPConfig != nil {
s.serverCfg.TLSSetting = tlsAdminHTTPConfig
_, err = s.serverCfg.TLSSetting.LoadTLSConfig(context.Background())
if err != nil {
return err
}
}

s.serverCfg.Endpoint = v.GetString(adminHTTPHostPort)
s.serverCfg.TLSSetting = tlsAdminHTTP.ToOtelServerConfig()
return nil
}

Expand Down

0 comments on commit 8720eb8

Please sign in to comment.