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

Removes deprecated function #2280 #2287

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions kubernetes/client/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ def __init__(self, resp):
self.reason = resp.reason
self.data = resp.data

def getheaders(self):
"""Returns a dictionary of the response headers."""
return self.urllib3_response.getheaders()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated by openapi-generator. Has this method been removed in a newer version of the generator? If so, was there a replacement?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, is it okay to simply drop this method? I'd expect that there are other places depending on this, and would be broken if we simply drop this method.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used e.g. here: https://github.com/kubernetes-client/python/blob/master/kubernetes/client/exceptions.py#L91

I would rather suggest to keep and fix it. e.g.

    def getheaders(self):
        """Returns a dictionary of the response headers."""
        return self.urllib3_response.headers

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One alternative is to restrict the version of urllib3 that this client can support (< 2.0.0). That doesn't seem to be a good user experience. I'm not sure what's the adoption rate of urllib3 >= 2.0.0 as of today. cc @yliaog

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind. 2.0.0 has been released for over a year: https://pypi.org/project/urllib3/#history



def getheader(self, name, default=None):
"""Returns a given response header."""
return self.urllib3_response.getheader(name, default)
Expand Down