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

SYFT_CONFIG environment variable not supported #1986

Closed
AidanDelaney opened this issue Aug 2, 2023 · 1 comment · Fixed by #2001
Closed

SYFT_CONFIG environment variable not supported #1986

AidanDelaney opened this issue Aug 2, 2023 · 1 comment · Fixed by #2001
Assignees
Labels
enhancement New feature or request

Comments

@AidanDelaney
Copy link
Contributor

What happened:

Running SYFT_CONFIG=foo syft package does not pick up the application config from file foo.

What you expected to happen:

Running syft -c bar packages results in the expected error unable to load config: unable to read application config="bar".

I would expect the same error when the config flag is set using an environment variable SYFT_CONFIG.

Steps to reproduce the issue:

  1. Run SYFT_CONFIG=foo syft packages

Notice that the error rror during command execution: an image/directory argument is required is produced. It should fail when the application configuration file is not found.

Anything else we need to know?:

The value of configPath is passed to Application.LoadAllValues. The decision on the value of top-level happens before we load values. The values of root options should come from a viper lookup, rather than from a pflag binding.

This is related to #1143, but is a smaller scoped issue.

Environment:

  • Output of syft version: latest git
  • OS (e.g: cat /etc/os-release or similar): macos & linux
@AidanDelaney AidanDelaney added the bug Something isn't working label Aug 2, 2023
@kzantow
Copy link
Contributor

kzantow commented Aug 2, 2023

@AidanDelaney thanks for the report -- the priority order issue. This happens to be something that we just started working on.

However, there is no option to use SYFT_CONFIG, you must specify a configuration file using the -c/--config flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
2 participants