Initial k8s support in libplayground (#216)

* Initial k8s support in libplayground

* Make tasks never give up + custom event for k8s cluster status
This commit is contained in:
Marcos Nils
2017-11-16 18:23:13 -03:00
committed by GitHub
parent dcb2bc7500
commit 3481442768
24 changed files with 1006 additions and 58 deletions

21
k8s/factory_mock.go Normal file
View File

@@ -0,0 +1,21 @@
package k8s
import (
"github.com/play-with-docker/play-with-docker/pwd/types"
"github.com/stretchr/testify/mock"
"k8s.io/client-go/kubernetes"
)
type FactoryMock struct {
mock.Mock
}
func (m *FactoryMock) GetKubeletForInstance(i *types.Instance) (*kubeletClient, error) {
args := m.Called(i)
return args.Get(0).(*kubeletClient), args.Error(1)
}
func (m *FactoryMock) GetForInstance(instance *types.Instance) (*kubernetes.Clientset, error) {
args := m.Called(instance)
return args.Get(0).(*kubernetes.Clientset), args.Error(1)
}