-
- Downloads
Feature/unit tests (#53)
- Avoid relying on Clientset structure to call Kubernetes API functions. While Clientset is a convinient "catch-all" abstraction for calling REST API related to different Kubernetes objects, it's impossible to mock. Replacing it wih the kubernetes.Interface would be quite straightforward, but would require an exra level of mocked interfaces, because of the versioning. Instead, a new interface is defined, which contains only the objects we need of the pre-defined versions. - Move KubernetesClient to k8sutil package. - Add more tests.
Showing
- cmd/main.go 3 additions, 3 deletionscmd/main.go
- pkg/cluster/cluster.go 1 addition, 2 deletionspkg/cluster/cluster.go
- pkg/controller/controller.go 5 additions, 4 deletionspkg/controller/controller.go
- pkg/controller/pod.go 2 additions, 2 deletionspkg/controller/pod.go
- pkg/controller/util.go 6 additions, 6 deletionspkg/controller/util.go
- pkg/controller/util_test.go 154 additions, 0 deletionspkg/controller/util_test.go
- pkg/spec/types.go 0 additions, 1 deletionpkg/spec/types.go
- pkg/util/k8sutil/k8sutil.go 30 additions, 1 deletionpkg/util/k8sutil/k8sutil.go
Loading
Please register or sign in to comment