Fill in Default Values for CPU/Memory (#130)

Update k8s client and the dependencies
ACI client change for Mocking
Add ACI Provider Mock Tests
Add the Windows development environment
Add UT for Default Resource Requests
Enable the make test in Docker file
Update the vendors
This commit is contained in:
Robbie Zhang
2018-04-16 10:31:16 -07:00
committed by GitHub
parent 88bafc701b
commit 2b85b0d1df
862 changed files with 61483 additions and 16781 deletions

View File

@@ -15,7 +15,7 @@ import (
// New ResourceManagers should be created with the NewResourceManager() function.
type ResourceManager struct {
sync.RWMutex
k8sClient *kubernetes.Clientset
k8sClient kubernetes.Interface
pods map[string]*v1.Pod
configMapRef map[string]int64
@@ -25,7 +25,7 @@ type ResourceManager struct {
}
// NewResourceManager returns a ResourceManager with the internal maps initialized.
func NewResourceManager(k8sClient *kubernetes.Clientset) *ResourceManager {
func NewResourceManager(k8sClient kubernetes.Interface) *ResourceManager {
rm := ResourceManager{
pods: make(map[string]*v1.Pod, 0),
configMapRef: make(map[string]int64, 0),

View File

@@ -1,36 +1,21 @@
package manager
import (
"log"
"testing"
"github.com/google/uuid"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/kubernetes/fake"
)
var (
fakeClient *kubernetes.Clientset
fakeClient kubernetes.Interface
)
func init() {
loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
// if you want to change the loading rules (which files in which order), you can do so here
configOverrides := &clientcmd.ConfigOverrides{}
// if you want to change override values or bind them to flags, there are methods to help you
kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, configOverrides)
config, err := kubeConfig.ClientConfig()
if err != nil {
log.Fatal("unable to create client config")
}
fakeClient, err = kubernetes.NewForConfig(config)
if err != nil {
log.Fatal("unable to create new clientset")
}
fakeClient = fake.NewSimpleClientset()
}
func TestResourceManager(t *testing.T) {