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

fix: Add tls flag to test command #908

Merged
merged 1 commit into from Feb 1, 2024

Conversation

oblogic7
Copy link
Contributor

@oblogic7 oblogic7 commented Jan 19, 2024

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.

Copy link
Member

@jalseth jalseth left a 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.

@@ -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 {
Copy link
Member

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.

@@ -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")
Copy link
Member

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.

@jalseth
Copy link
Member

jalseth commented Jan 28, 2024

@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>
@oblogic7
Copy link
Contributor Author

Sorry for the delay. This should be ready now.

@jalseth jalseth merged commit b9d91d0 into open-policy-agent:master Feb 1, 2024
7 checks passed
@jalseth
Copy link
Member

jalseth commented Feb 1, 2024

No problem, I just wanted to make sure this would make it in the release. Thanks for the PR!

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

Successfully merging this pull request may close these issues.

None yet

3 participants