ManageIQ / kubeclient

A Ruby client for Kubernetes REST API
MIT License
416 stars 166 forks source link

support impersonation via auth_options and in kubectl config #600

Closed DocX closed 1 year ago

DocX commented 1 year ago

This PR is rebase and update of https://github.com/ManageIQ/kubeclient/pull/524 to current master version

We tested it and it works as expected

Ruby http clients (including adapters for Faraday) are not able to handle multiple headers of same name, which is how the kube API expects to receive the list of multiple groups or extra fields. To avoid any confusion, added explicit error when trying to configure client with multivalue groups. This may brake some applications, if user is not aware of the impersonation setting and were ignoring it until now

cben commented 1 year ago

What about watches?

Watches still use https://github.com/httprb/http gem (#488 having some unresolved issues).
Does this implementation affect the headers we send there too? I think so, http_options method takes @headers.

Otherwise LGTM :rocket:

DocX commented 1 year ago

@cben thanks for the review. I've added the changelog and unit test for watch. Please take a look.

DocX commented 1 year ago

Thanks @cben. Is there any plan to publish new release with the update?

cben commented 1 year ago

I need to make progress on my 5.0 changelog backlog to get master branch releasable... I'm sorry, I can't give time estimate. But nagging is welcome ;-|

Alternatively, do you want to work on backporting this to v4.y branch which uses rest-client? It'd require some changes, not sure it's worth the effort.

DocX commented 1 year ago

Ok, no problem. Just asking. It is not super critical for us, so we can wait (and we can always install gem from git if we need to)