Make duck-typing checking in serialize_body method more restrictive#241
Conversation
|
Welcome @piglei! |
|
/assign @yliaog |
|
/lgtm /assign @fabianvf |
fabianvf
left a comment
There was a problem hiding this comment.
/lgtm, needs rebase though
|
/approve |
Rebased with upstream/master. |
|
PR refreshed. |
|
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
please squash the commits |
fd876b7 to
66a45cd
Compare
Done |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabianvf, piglei, yliaog The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@piglei just needs the release note and it should be good to go |
Thanks for reminding me, the release note was now added. |
The
bodyparameter inDynamicClient's most methods currently accepts both dict type andResourceInstancetype. This was achieved by callingserialize_body()before mading any requests.But in current implementation, the duck-typing style checking in
serialize_bodywas kind of meaning-less---ResourceInstancetype has overwritten it's__getattr__method, so basically it's instances can pass everyhasattr(...)check.This PR makes the checking in
serialize_body()method more restrictive and also add some related unit tests.Release Note: