What would you like to be added:
kind works great for adhoc local development or end-to-end tests written in bash/make 鉂わ笍it's currently a bit fiddly to invoke directly from Go as a library - I'm not sure how many people are trying to do this yet, but I couldn't find any good examples anywhere. I've written a small library here that provides a lightweight API in return for some opinionated defaults: https://github.com/milesbxf/empathy
This could just be a case of documenting how to do this somewhere/what boilerplate is needed, but I think it'd be helpful to provide a simple API folks can just drop into their tests. I'd be open to raising a PR that implements some of the things from the aforementioned library if that works :)
Why is this needed:
Being able to write integration tests/end-to-end tests that create and interact with Kube clusters entirely in Go is pretty handy:
go test ./e2e which allows you to add flags easilyHi, this is a neat project, however, we'd prefer people build their opinionated versions out of tree.
kind actually has its own opinionated defaults if you do not pass any options to Create(...).
we're not focused on the go library right now for a few reasons:
aside this should not be necessary? kind follows the rules for creating these files laid out by kubectl. If you explicitly specify the kubeconfig path it will use and create it.
https://github.com/milesbxf/empathy/blob/f4767ba3fede63e07b5ceb852c62623edf546eb7/cluster.go#L34-L41
thanks again for sharing. we'll add better examples and re-introduce "kind as a library" to our docs when it's internally more stable and ready for this.
Thanks @BenTheElder - that makes sense 馃檶
Most helpful comment
Hi, this is a neat project, however, we'd prefer people build their opinionated versions out of tree.
kind actually has its own opinionated defaults if you do not pass any options to
Create(...).we're not focused on the go library right now for a few reasons:
aside this should not be necessary? kind follows the rules for creating these files laid out by
kubectl. If you explicitly specify the kubeconfig path it will use and create it.https://github.com/milesbxf/empathy/blob/f4767ba3fede63e07b5ceb852c62623edf546eb7/cluster.go#L34-L41
thanks again for sharing. we'll add better examples and re-introduce "kind as a library" to our docs when it's internally more stable and ready for this.