Frankkkkk / pykorm

A python 🐍 kubernetes ☸️ ORM πŸš€. Very useful when writing operators for your CRDs with Kopf.
MIT License
73 stars 4 forks source link

Dont send to k8s None fields #9

Closed Frankkkkk closed 4 years ago

Frankkkkk commented 4 years ago

When creating aand saving a model with some empty (non mandatory) fields, it will fail because of the default value which will be None.

We should skip this attribute.

Frankkkkk commented 4 years ago

Still missing some tests

Frankkkkk commented 4 years ago

Another workaround: use DataField.get_data in Model._k8s_dict

AnyISalIn commented 4 years ago

There will be some problems. It cannot handle some updated scenes.

For example, if you need to delete a field of resource, must be sent field: null to Kubernetes Patch API (or replace)

I currently deal with this problem in business logic, but I want to be able to decentralize to the model layer.