Open mindw opened 7 years ago
Same here.
By examining the code, It looks like it is impossible to modify POST request, because there is no way to change values of these variables:
query_params = {}
header_params = {}
form_params = []
local_var_files = {}
body_params = None
all of them can be found in all of the following functions defined in the CoreV1Api:
connect_post_namespaced_service_proxy_with_http_info
connect_post_namespaced_service_proxy_with_path_with_http_info
proxy_post_namespaced_service_with_http_info
proxy_post_namespaced_service_with_path_with_http_info
Maybe it is connected somehow to the way python client code was generated by the swagger-codegen?
The spec provided by kubernetes main repo only has three parameters for these calls name
, namespace
and path
. If there is a parameter such as body
that is missing, we need to add it to the spec hopefully as a fix in kubernetes itself. What are the missing parameters? is it only body? Can you guys run the same commands with kubectl -v9
and confirm missing parameters?
Sent a fix for this: https://github.com/kubernetes/kubernetes/pull/54266 If that gets merged, the next version of the client (5.0) should have the fix. Meanwhile we can decide if we want to patch this back into our 4.0 client.
@mbohlool any news on this one? thanks!
looking at the latest code, I'm still not seeing a way to pass in custom headers, for example. Is there something that I'm missing maybe?
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Mark the issue as fresh with /remove-lifecycle rotten
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close
@fejta-bot: Closing this issue.
/reopen /assign
@roycaihw: Reopened this issue.
/remove-lifecycle rotten
What is the difference between the plain &
_with_path
APIs
I believe those work the same. Kubernetes apiserver allows the request to specify the subpath that you want to connect to either through a query parameter or by directly composing the URL path. Those two APIs reflect the options that the openapi spec gives.
What is the difference between the two sets of APIs?
connect_post_XXX proxy_post_XXX
the proxy_*
methods are deprecated and removed, use connect_*
instead
was unable to attach a body (or extra headers to them)
the upstream openapi spec needs to be fixed so that this client library can support writing body and additional headers. I will take a stab
Any update on this? Working on service that accepts POST, PUT, and PATCH requests. It looks like the kubernetes Go client is working, but as mentioned before, the Python client still does not accept body
params.
For now we are using kubectl proxy --port=8080
and http://localhost:8080/api/v1/namespaces/<namespace>/services/<service>/proxy/<path>
as a workaround for testing.
@jbyers19 as a workaround, you could use the 'call_api' method directly, sorta like:
path_params = {
"name": "https:argocd-server:443",
"namespace": "default",
"path": "api/v1/session"
}
body = {
"username": "admin",
"password": "password"
}
response = v1.api_client.call_api(
'/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}', 'POST',
path_params,
[],
{"Accept": "*/*"},
body=body,
post_params=[],
files={},
response_type='str',
auth_settings=["BearerToken"],
async_req=False,
_return_http_data_only=True,
_preload_content=True,
_request_timeout=None,
collection_formats={})
I'm using the async python client, but this should work with the sync one too I'd guess.
I'm trying to convert this into a good first issue / help wanted issue here. To fix the upstream openapi spec, one need to first fix the API installer who constructs the WebService, then regenerate the openapi spec using make generated_files
In the installer I think we are basically missing a .Reads(...)
call and potentially a body parameter registration here. One can see other operations who take body
parameters as example (delete, create). The tricky part is figuring out if the endpoint expects any schema from the body (seems to be arbitrary) and how to represent that in WebService (something like interface{}
?)
/unassign
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/remove-lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten
/remove-lifecycle stale
/remove-lifecycle rotten
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten
/remove-lifecycle rotten
almost 4 years :(
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
tried that but was getting the same 503 error for a GET request with. service proxy. it seems that the url encoding happening within api_client.py __call_api method is breaking the request. As a workaround I made the call directly to api_client.request and that fixed the issue.
as a sidenote. Golang api is sending the request to https://host:port/api/v1/namespaces/${NAMESPACE}/services/${SERVICE_NAME}:http/path/to/resource while python does something completely different. once I made the url look like golang then it worked.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
I'm trying to make a post request via the proxy API to a service without the k8s cluster without much luck. Found the below candidate API -
But was unable to attach a body (or extra headers to them):
_with_path
APIs (the documentation for bot?connect_post_namespaced_service_proxy_with_path: :param str path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.
connect_post_XXX proxy_post_XXX