Frankkkkk / pykorm

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

Support `status` subresource #41

Open arnarg opened 2 years ago

arnarg commented 2 years ago

In most cases the status field in the root is a subresource and can't be updated with the same api as spec or metadata. There are separate APIs like create_namespaced_pod_status, patch_namespaced_custom_object_status, etc.

I've worked around this by creating a mixin that I add to all model classes and provides a method that calls the relevant *_status variant of the APIs but it would be nice if this could be supported by pykorm directly. Either by calling both on save()/apply() if there is a Status field in the model or even a separate way (pk.status().save(obj), pk.save_status(obj), ...).