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

CONFTEST_TRACE env var does not set --trace flag #1031

Open
tonglil opened this issue Dec 19, 2024 · 1 comment
Open

CONFTEST_TRACE env var does not set --trace flag #1031

tonglil opened this issue Dec 19, 2024 · 1 comment

Comments

@tonglil
Copy link

tonglil commented Dec 19, 2024

As of v0.55.0, the CONFTEST_TRACE env var does not seem to set the conftest test --trace flag.

@thevilledev
Copy link

Could not reproduce this on v0.55.0 or v0.56.0 (latest) on macOS 15.2. These commands produce identical output, sometimes in different order:

$ CONFTEST_TRACE=true conftest test examples/kubernetes/service.yaml -p examples/kubernetes/policy

$ conftest test --trace examples/kubernetes/service.yaml -p examples/kubernetes/policy

Looking at the code:

  • internal/commands/default.go sets the env var prefix correctly
  • internal/commands/test.go binds flagname trace correctly
  • TestRunner struct in runner/test.go has a Trace field, and Viper binds struct fields to variables case-insensitively. Even though the struct tag mapstructure:"trace" is missing I think this should work.

Which environment was this failing on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants