-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Adds the K6_INFLUXDB_PROXY environment variable support, closes #3418 #3423
Adds the K6_INFLUXDB_PROXY environment variable support, closes #3418 #3423
Conversation
I ran tests and only timeout test has failed, also fails when executed from the master branch so I doubt it has anything to do with my changes. I didn't comment anything since my change is really small and obvious. |
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.
LGTM in general, thanks 🙇
But can you change the way it is set currently, and I would prefer if we have at least one config test. And if possible actually test the proxying?
I also saw that you didn't change it to be parsable from the cli directly (see ParseURL
in the config.go).
I am not certain how good of an idea is to support this ... given that I think it will need to be escaped quite a lot. So I kind of don't think you need to do it , but let's see what @codebien thinks as well
61b24d7
to
edac25a
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #3423 +/- ##
==========================================
- Coverage 73.33% 73.27% -0.07%
==========================================
Files 258 256 -2
Lines 19645 19646 +1
==========================================
- Hits 14407 14395 -12
- Misses 4353 4361 +8
- Partials 885 890 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
edac25a
to
ffd12fa
Compare
@mstoykov Yeah, I would prefer if we avoid it. An URL in another URL doesn't sound like the best UX. |
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.
As @mstoykov reported, we should add a test for it.
@@ -17,6 +17,7 @@ import ( | |||
type Config struct { | |||
// Connection. | |||
Addr null.String `json:"addr" envconfig:"K6_INFLUXDB_ADDR"` | |||
Proxy null.String `json:"proxy,omitempty" envconfig:"K6_INFLUXDB_PROXY"` |
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.
Proxy null.String `json:"proxy,omitempty" envconfig:"K6_INFLUXDB_PROXY"` | |
Proxy null.String `json:"proxy,omitempty" envconfig:"K6_INFLUXDB_HTTP_PROXY"` |
@IvanovOleg @mstoykov WDYT? Should we do it? I like the consistency with the original HTTP_PROXY variable, but on the other side, I'm not sure because it could introduce confusion around the expected HTTP/S value.
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.
I can change the name as you suggested, no problem. The reason I named it like that because it will work with http and https at the same time
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.
Added a config test for the K6_INFLUXDB_PROXY variable.
1fe9a57
to
62910f6
Compare
62910f6
to
c0829aa
Compare
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.
@mstoykov I checked the returned UX in case of error and it seems fine to me.
ERRO[0000] could not create the 'influxdb' output: failed to parse the http proxy URL: parse "http://foo\x7f.com/": net/url: invalid control character in URL
81c0124
to
9ac559e
Compare
9ac559e
to
d8e9b0a
Compare
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 this change @IvanovOleg
What?
This PR closes #3418 by adding the K6_INFLUXDB_PROXY environment variable support.
Why?
This PR fixes the problem when your InfluxDB server is not opened for direct connections and requires a connection through proxy.
Checklist
make lint
) and all checks pass.make tests
) and all tests pass.Related PR(s)/Issue(s)
Closes #3418