python icon indicating copy to clipboard operation
python copied to clipboard

Unable to deserialize models with attributes of type RuntimeRawExtension

Open fabianvf opened this issue 7 years ago • 16 comments

Minimal example for ControllerRevision (requires an active kubernetes cluster with working kubeconfig):

from kubernetes import client, config

config.load_kube_config()
apps_v1beta1_api = client.AppsV1beta1Api()
controller_revisions = apps_v1beta1_api.list_controller_revision_for_all_namespaces()

Issue seems to be here: https://github.com/kubernetes-client/python/blob/master/kubernetes/client/api_client.py#L617

 if data is not None \
                   and klass.attribute_map[attr] in data \  # <-- here
                   and isinstance(data, (list, dict)):
    value = data[klass.attribute_map[attr]]
    kwargs[attr] = self.__deserialize(value, attr_type)

where it is looking for the 'Raw' attribute in data, but data is a freeform JSON object with no specific 'Raw' key. Because this conditional fails, nothing is ever added to kwargs, and RuntimeRawExtension is initialized without the required raw value.

fabianvf avatar Feb 22 '18 20:02 fabianvf

Here's a patch to the openshift-restclient-python that at least partially works around this issue. https://github.com/openshift/openshift-restclient-python/pull/159/files

fabianvf avatar Feb 27 '18 16:02 fabianvf

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

fejta-bot avatar Apr 22 '19 22:04 fejta-bot

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

fejta-bot avatar May 22 '19 22:05 fejta-bot

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 avatar Jun 22 '19 00:06 fejta-bot

@fejta-bot: Closing this issue.

In response to this:

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

Instructions 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.

k8s-ci-robot avatar Jun 22 '19 00:06 k8s-ci-robot

/reopen

This is still broken. Can we port the fix from openshift to this library?

alfredkrohmer avatar Nov 07 '19 12:11 alfredkrohmer

@devkid: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen

This is still broken. Can we port the fix from openshift to this library?

Instructions 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.

k8s-ci-robot avatar Nov 07 '19 12:11 k8s-ci-robot

/reopen

fabianvf avatar Nov 12 '19 19:11 fabianvf

@fabianvf: Reopened this issue.

In response to this:

/reopen

Instructions 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.

k8s-ci-robot avatar Nov 12 '19 19:11 k8s-ci-robot

/remove-lifecycle rotten

fabianvf avatar Nov 22 '19 21:11 fabianvf

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

fejta-bot avatar Feb 20 '20 22:02 fejta-bot

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

fejta-bot avatar Mar 21 '20 22:03 fejta-bot

/remove-lifecycle rotten

palnabarun avatar Mar 25 '20 20:03 palnabarun

/lifecycle frozen

palnabarun avatar Mar 25 '20 20:03 palnabarun

Has it been fixed in latest release? If not, I would like to cherrypick the patch and fix this. :)

whypro avatar Apr 08 '20 11:04 whypro

I hit the same bug while trying to get the pods owned by a daemonset without looking at all pods in a namespace. Any chance to fix it?

brutus333 avatar May 28 '20 05:05 brutus333