Skip to content

Commit

Permalink
Update windows execute
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerHelmuth committed Aug 26, 2022
1 parent 6647d57 commit 51069ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion service/collector_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package service // import "go.opentelemetry.io/collector/service"

import (
"context"
"errors"
"flag"
"fmt"
"os"
Expand Down Expand Up @@ -143,7 +144,13 @@ func openEventLog(serviceName string) (*eventlog.Log, error) {
func newWithWindowsEventLogCore(set CollectorSettings, flags *flag.FlagSet, elog *eventlog.Log) (*Collector, error) {
if set.ConfigProvider == nil {
var err error
cfgSet := newDefaultConfigProviderSettings(getConfigFlag(flags))

configFlags := getConfigFlag(flags)
if len(configFlags) == 0 {
return nil, errors.New("at least one config flag must be provided")
}

cfgSet := newDefaultConfigProviderSettings(configFlags)
// Append the "overwrite properties converter" as the first converter.
cfgSet.ResolverSettings.Converters = append(
[]confmap.Converter{overwritepropertiesconverter.New(getSetFlag(flags))},
Expand Down

0 comments on commit 51069ca

Please sign in to comment.