-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: Add proxy support to CLI API client #12527
base: main
Are you sure you want to change the base?
Conversation
17ce132
to
d78c157
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.
Can you add some tests in apiclient_test.go and facade_test.go? Thanks
Okay, thanks. I'll give it a try. However, it might take me some time. |
5103e5a
to
b69677d
Compare
@isubasinghe |
As suggested by @monaka in #12827 (comment), closing as implemented by #12867. |
Oops, this isn't implemented there. |
Signed-off-by: shimako55 <[email protected]>
…returned based on configuration Signed-off-by: shimako55 <[email protected]>
b69677d
to
b1226a7
Compare
Signed-off-by: shimako55 <[email protected]>
065e8a8
to
cac0ae3
Compare
Requesting a review for this PR. |
Hello @isubasinghe |
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 wasn't able to get this to work, I ran a proxy server (https://github.com/neevek/omnip) on 8899.
I got: "./argo template list --proxy-url=http://localhost:8899"
I then tried to manually set the argo-server URL to localhost:2746.
When I did this, I did get this in my cli:
FATA[2024-11-29T14:07:09.786Z] could not find a token
Can you take another look at this please?
Thanks @isubasinghe 1. Test EnvironmentInstalled Argo Workflows in local environment using kind 2. Server Connection SetupSet up port forwarding to connect to the Argo server in the Kubernetes cluster: kubectl -n argo port-forward service/argo-server 8080:2746 3. Environment Variables ConfigurationSet required environment variables for Argo CLI connection: export ARGO_SERVER='localhost:8080'
export ARGO_HTTP1=true
export ARGO_SECURE=true
export ARGO_BASE_HREF=
export ARGO_TOKEN=''
export ARGO_NAMESPACE=argo 4. Proxy Server LaunchStarted proxy server using omnip: omnip -a http://0.0.0.0:8081 -lD 5. Operation Check ResultsArgo CLI Verificationargo list -k --proxy-url=http://localhost:8081 Execution Result
Proxy Server Logs
|
Fixes #10794
Motivation
Issue:
In the current version of Argo Workflows, the API client does not function properly in environments that use a proxy server.
Purpose:
This PR aims to modify the Argo Workflows API client to ensure it functions correctly when routing through a proxy server.
Modifications
Summary of Changes:
Made modifications in
cmd/argo/commands/client/conn.go
,pkg/apiclient/apiclient.go
,pkg/apiclient/http1-client.go
, andpkg/apiclient/http1/facade.go
.Specific Changes:
Added proxy functionality using
http.ProxyURL
.Integrated new proxy settings into the API client construction process.
Added proxy settings to the configuration of
http.Client
andhttp.Transport
.Reason for Changes:
To support the operation of the API client in proxy environments.
Verification
Testing Method:
Conducted manual tests in an environment with a configured proxy server.
Test Results:
Confirmed that the API client operates correctly when routing through a proxy.
Reproduction Steps:
Replace http://example.com:8080 with your actual proxy server URL in the following commands:
or