Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add WithIgnoreUndefined option to config parse #1839

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/launcher/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ func ParseOptions(subcommandName string, args []string) (*Options, error) {
ffOpts := []ff.Option{
ff.WithConfigFileFlag("config"),
ff.WithConfigFileParser(ff.PlainParser),
ff.WithIgnoreUndefined(true), // silently discard any unknown options and keep parsing
}

// Windows doesn't really support environmental variables in quite
Expand All @@ -290,6 +291,9 @@ func ParseOptions(subcommandName string, args []string) (*Options, error) {
ffOpts = append(ffOpts, ff.WithEnvVarPrefix("KOLIDE_LAUNCHER"))
}

// TODO for discussion - i suspect with WithIgnoreUndefined set we could
// check for and return errors here and that would be less confusing if there
// are ever other parsing issues. Currently we would have no idea
ff.Parse(flagset, args, ffOpts...)

// handle --version
Expand Down
Loading