All examples are rooted in a directory that holds a standalone golang module with a replace directive to consume the local version of kubedog
.
- Clone the repository
- Move to the directory of the example you want to run
- Run
go test
for usage and templating/kubego run main.go
for templating/generic
To run the examples outside of the repository, you need to remove the replace directive and use a valid kubedog
version.
- usage/features/deploy-pod.feature: is the
*.feature
file defining the behavior to test - usage/templates: holds the Kubernetes yaml files, they could be templated
- usage/main_test.go: is the test implementation with the minimum recommended setup for
godog
andkubedog
The kube package has built-in templating support, this example showcases that.
- templating/kube/features/deploy-pod.feature: same as usage
- templating/kube/templates: similar to usage, but the files are templated
- templating/kube/main_test.go: similar to usage, but it adds templating implementation
The generic package offers general purpose file templating, this example showcases that.
- templating/generic/files: templated files
- templating/generic/main.go: templating implementation