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

✨ Add proxy option #136

Merged
merged 4 commits into from
Jan 11, 2024
Merged

✨ Add proxy option #136

merged 4 commits into from
Jan 11, 2024

Conversation

aufi
Copy link
Member

@aufi aufi commented Jan 8, 2024

Adding proxy command line option to specify proxy string as an argument. THe proxy s passed to analyzer providers settings.

Fixes: #11

Adding `proxy` command line option to specify proxy string as an
argument. THe proxy s passed to analyzer providers settings.

Fixes: konveyor#11

Signed-off-by: Marek Aufart <maufart@redhat.com>
@shawn-hurley
Copy link
Contributor

This is looking great, can we make sure to have the NOPROXY settings as well as use environment variables

aufi added 2 commits January 8, 2024 15:39
Signed-off-by: Marek Aufart <maufart@redhat.com>
Signed-off-by: Marek Aufart <maufart@redhat.com>
@aufi aufi marked this pull request as ready for review January 8, 2024 15:57
cmd/analyze.go Outdated
@@ -162,8 +163,9 @@ func NewAnalyzeCmd(log logr.Logger) *cobra.Command {
analyzeCommand.Flags().BoolVar(&analyzeCmd.overwrite, "overwrite", false, "overwrite output directory")
analyzeCommand.Flags().StringVar(&analyzeCmd.jaegerEndpoint, "jaeger-endpoint", "", "jaeger endpoint to collect traces")
analyzeCommand.Flags().BoolVar(&analyzeCmd.enableDefaultRulesets, "enable-default-rulesets", true, "run default rulesets with analysis")
analyzeCommand.Flags().StringVar(&analyzeCmd.proxy, "proxy", "", "HTTP&HTTPS proxy string URL")
analyzeCommand.Flags().StringVar(&analyzeCmd.noProxy, "no-proxy", "", "proxy excluded URLs (relevant only with `proxy`)")
analyzeCommand.Flags().StringVar(&analyzeCmd.httpProxy, "http-proxy", os.Getenv("http_proxy"), "HTTP proxy string URL")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small concern, would be that the default value printed out here, would be changed based on env var.

Also I think you will need to handle both http_proxy and HTTP_PROXY.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for comment! Printing actual default values in help didn't look bad to me.
What I've been looking on proxy env variables, lower case http_proxy is much more common than HTTP_PROXY. However, please update me if mentioned issues needs to be addressed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure it does; Docker, I think, only uses uppercase, and I think Openshift does as well.

Copy link
Member Author

@aufi aufi Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 will update!

@aufi aufi changed the title Add proxy option ✨ Add proxy option Jan 9, 2024
Signed-off-by: Marek Aufart <maufart@redhat.com>
@aufi aufi requested a review from shawn-hurley January 10, 2024 11:07
Copy link
Contributor

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@aufi aufi merged commit ab855f7 into konveyor:main Jan 11, 2024
2 checks passed
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.

Add an option to handle proxy configuration
3 participants