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

connect_get_namespaced_service_proxy_with_path messes up response #2158

Open
david0 opened this issue Dec 5, 2023 · 3 comments
Open

connect_get_namespaced_service_proxy_with_path messes up response #2158

david0 opened this issue Dec 5, 2023 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@david0
Copy link
Contributor

david0 commented Dec 5, 2023

What happened (please include outputs or screenshots):

Im running connect_get_namespaced_service_proxy_with_path(name, namespace, path="actuator") to get JSON data from my webservice.

The result is a JSON list:
["foo", "bar"]

but the function returns
['foo', 'bar']

What you expected to happen:
The function to return ["foo", "bar"] or to return the list or a bytearray.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

It looks like the deserialisation messes it up. It can be worked around by passing _preload_content=False

Environment:

  • Kubernetes version (kubectl version): v1.25.13
  • OS (e.g., MacOS 10.13.6): MacOS 13.6
  • Python version (python --version): Python 3.9.17
  • Python client version (pip list | grep kubernetes): 28.1.0
@david0 david0 added the kind/bug Categorizes issue or PR as related to a bug. label Dec 5, 2023
@roycaihw
Copy link
Member

The result is a JSON list:
["foo", "bar"]

but the function returns
['foo', 'bar']

Could you elaborate what's the difference between the two responses?

@david0
Copy link
Contributor Author

david0 commented Feb 12, 2024

The webservice that I'm trying to connect will return a JSON list of strings (with doublequotes): ["foo", "bar"]

connect_get_namespaced_service_proxy_with_path(name, namespace, path="actuator") will return a str with the value ['foo', 'bar'] , which is very unexpected for me. I mean it looks on first sight like a valid python list, but its returned as a str(!) instead of list.

If the return value would be a list, it would be fine. But I guess intuitively everyone would expect that it would return the raw, original response string ["foo", "bar"]

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants