gtsystem / lightkube

Modern lightweight kubernetes module for python
https://lightkube.readthedocs.io
MIT License
96 stars 11 forks source link

Add server side apply enhancement #22

Closed stonepreston closed 2 years ago

stonepreston commented 2 years ago

This PR addresses issue #16 and adds an enhancement that allows one to easily create new objects and patch existing objects using a server side apply operation. A user can now create or patch existing objects from a yaml file using:

    with open('deployment.yaml') as f:
        for obj in codecs.load_all_yaml(f):
            client.server_side_apply(obj)
gtsystem commented 2 years ago

Hi, I was also working last weekend on this improvement, see #23 :) How do we proceed? I think my branch have few more features like support for field_manager in the client constructor and overrides in Client.create(), Client.patch() and Client.replace(). Also support for server side apply for Client.patch() command.

stonepreston commented 2 years ago

Hi, I was also working last weekend on this improvement, see #23 :) How do we proceed? I think my branch have few more features like support for field_manager in the client constructor and overrides in Client.create(), Client.patch() and Client.replace(). Also support for server side apply for Client.patch() command.

Yeah your PR looks like its the better way to go. I can delete this one once yours gets merged in.

stonepreston commented 2 years ago

23 provides this functionality, closing this PR