kubernetes-client / kubernetes-client/python
Unable to deserialize models with attributes of type RuntimeRawExtension
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 7.7k
- Forks
- 3.5k
- Merge médio
- 1d 14h
- PRs com merge (30d)
- 18
Descrição
Minimal example for ControllerRevision (requires an active kubernetes cluster with working kubeconfig):
```python
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
```python
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.
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece em kubernetes/client/api_client.py, por volta da linha 617, e reproduza o exemplo de ControllerRevision com um cluster Kubernetes ativo e um kubeconfig funcional. Rastreie a desserialização do JSON livre em RuntimeRawExtension; ela ocorre quando o modelo resultante preserva o valor bruto em vez de ser inicializado sem ele.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- api
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100