felixfbecker / PSKubectl

kubectl with the power of the object pipeline
MIT License
61 stars 9 forks source link

Implement creating resources with Update-KubeResource #8

Closed felixfbecker closed 5 years ago

felixfbecker commented 6 years ago

It currently only handles patches

MortenMeisler commented 5 years ago

yes! Upvote. I can see you are using the client.Dynamic().Patch method from KubeClient, any plan to make the same functionality for Create? Or would that require that the KubeClient library have the same kind of dynamic interface for patch?

It seems like the method is strongly typed, ex.: await client.DeploymentsV1().Create(deploymentV1); would be nice to have support for dynamic as well or make a generic function. I'm probably not sharp enough on the c# for that..would it be possible to extend the method somehow?

felixfbecker commented 5 years ago

I am not 100% sure but I think with server-side apply, sending a PATCH for a non-existent resource should create it. Otherwise the dynamic client would need to receive support for Create which doesn't seem difficult (cc @tintoy).

The first useful step would be to write a Pester test that calls Update-KubeResource on a non-existent resource and asserts it's being created.

MortenMeisler commented 5 years ago

Alright thanks for the answer, you know when this is coming? I saw various posts on alpha/beta release, but we're using AKS which is running Kubernetes 1.14 atm.

tintoy commented 5 years ago

Yeah I think this depends on the semantics for server-side apply. I’ll have a look when I get home :)

felixfbecker commented 5 years ago

:tada: This issue has been resolved in version 0.12.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: