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
fix: Add tls flag to test command #908
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I am ok with the intent, just some minor changes.
internal/commands/test.go
Outdated
@@ -110,6 +110,9 @@ func NewTestCommand(ctx context.Context) *cobra.Command { | |||
return fmt.Errorf("bind flag: %w", err) | |||
} | |||
} | |||
if err := viper.BindPFlag("tls", cmd.Flags().Lookup("tls")); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, please add tls
to the list above.
internal/commands/test.go
Outdated
@@ -185,6 +188,7 @@ func NewTestCommand(ctx context.Context) *cobra.Command { | |||
cmd.Flags().StringSliceP("data", "d", []string{}, "A list of paths from which data for the rego policies will be recursively loaded") | |||
|
|||
cmd.Flags().StringSlice("proto-file-dirs", []string{}, "A list of directories containing Protocol Buffer definitions") | |||
cmd.Flags().BoolP("tls", "s", true, "Use TLS to access the registry") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this a Bool()
call rather than BoolP
. A single-letter alias of s
for the tls
flag does not make sense.
@oblogic7 If you would like this change to be in the next conftest release, please update the CL in the next couple of days. |
The pull command uses TLS by default by way of the value set for the `tls` flag. This change updates the `--update` flag on the test command to use TLS by default to align with the pull command. Signed-off-by: Matt Snyder <msnyder@repay.com>
Sorry for the delay. This should be ready now. |
No problem, I just wanted to make sure this would make it in the release. Thanks for the PR! |
The pull command uses TLS by default by way of the default value set for the
tls
flag. This change updates the test command so--update
flag can use TLS by default to align with the pull command.