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

Command line flags not overriding configuration file values #1143

Closed
spiffcs opened this issue Aug 4, 2022 · 2 comments · Fixed by #2001
Closed

Command line flags not overriding configuration file values #1143

spiffcs opened this issue Aug 4, 2022 · 2 comments · Fixed by #2001
Assignees
Labels
bug Something isn't working community-meeting Issue Originated from Community Meeting good-first-issue Good for newcomers

Comments

@spiffcs
Copy link
Contributor

spiffcs commented Aug 4, 2022

What happened:
When running syft -vv alpine:latest an error will occur if the configuration file is also set for verbosity.

What you expected to happen:
No error for syft to occur with command line flags and config set.

How to reproduce it (as minimally and precisely as possible):

run syft -vv alpine:latest with a configuration file also configured with log settings

log:
  # use structured logging
  # same as SYFT_LOG_STRUCTURED env var
  structured: false

  # the log level; note: detailed logging suppress the ETUI
  # same as SYFT_LOG_LEVEL env var
  level: "error"

  # location to write the log file (default is not to have a log file)
  # same as SYFT_LOG_FILE env var
  file: ""

Anything else we need to know?:
Community Meeting origin 8/4

Environment:

  • Output of syft version: v0.53.4
  • OS (e.g: cat /etc/os-release or similar):
  • OSX
@spiffcs spiffcs added bug Something isn't working community-meeting Issue Originated from Community Meeting good-first-issue Good for newcomers labels Aug 4, 2022
@kzantow
Copy link
Contributor

kzantow commented Nov 8, 2022

NOTE: this looks like the command line precedence has an issue. It was just reported the same thing was happening for --output on the community Slack: https://anchorecommunity.slack.com/archives/C4PJFNEEM/p1667844831946429

@kzantow kzantow changed the title When running syft with command line args for verbosity the command fails if the configuration is set Command line flags not overriding configuration file values Nov 8, 2022
@kzantow
Copy link
Contributor

kzantow commented Mar 11, 2023

There is also a problem with command line flags overriding any config. An example is:

SYFT_OUTPUT=table syft alpine:latest -o json

... outputs the table instead of json but the command line parameter should override the environment variable (and config file).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community-meeting Issue Originated from Community Meeting good-first-issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants