Description
Currently, the generated model has a builder-like structure baked inside the model objects.
Given the depth of the model, it would really help if the builders supported more advanced features like nesting, visitors and in-lining (similar to what we have in the https://github.com/fabric8io/kubernetes-client).
nesting makes it so much easier to create model objects directly in java. It's faster to write, it's more IDE friendly etc.
visitors allow making changes, without having to explicitly traverse the object tree. (e.g. allows doing things like visit all Pod Specs in the tree and add a sidecar container
without having to care if the spec is under a Deployment, DeploymentConfig, Pod, ReplicaSet etc).
in-lining allows to use the builder structure but instead of building the object directly to pass the object to a function. This allows to seamlessly integrate the builder into the client dsl.
Now, if we could get those builders either as part of the kubernetes module, it would open up the room of aligning with the https://github.com/fabric8io/kubernetes-client.
Activity
brendandburns commentedon Dec 14, 2017
Feel free to start writing them :)
io.kubernetes.client.fluent
or somesuch...We could also generate them, I suppose, but someone needs to write the generator...
brendandburns commentedon Dec 14, 2017
(another option is to use protocol buffers and the proto-client which are somewhat more fluent, in some ways)
iocanel commentedon Dec 15, 2017
@brendanburns: I've written a generator myself that we used for the fabric8 kubernetes-client.
So let'me try to integrate it and see how it goes.
pires commentedon Feb 16, 2018
@iocanel did you make any progress?
iocanel commentedon Feb 16, 2018
brendandburns commentedon Feb 27, 2018
@iocanel cool, would love to see it!
saturnism commentedon Apr 4, 2018
would love to see this merged! i enjoy the fabric8 client a lot :)
rhuss commentedon Jul 21, 2018
@iocanel I know, it has been some time and you are probably still very busy. But is there any chance for this PR still to happen ? 'would be really happy to help out here, too, as I think it would be a super awesome addition. We need something like this for the fabric8-maven-plugin to switch and would love to switch to kubernetes-client.
Merge pull request #323 from iocanel/fluent
brendandburns commentedon Sep 7, 2018
This was fixed with #323 and #357 has an example.