Remove setting taint during e2e test (#621)

We're in effect testing the K8s scheduler logic in the test
by setting taints, as opposed to the actual VK itself. If we
want to make sure the taint is set, we can just observe the node
object.

Instead, bind to the pod to the VK node explicitly.
This commit is contained in:
Sargun Dhillon
2019-05-17 10:49:37 -07:00
committed by Brian Goff
parent 5b3190acb5
commit 9bf05b525d
4 changed files with 12 additions and 57 deletions

View File

@@ -8,23 +8,17 @@ import (
// Framework encapsulates the configuration for the current run, and provides helper methods to be used during testing.
type Framework struct {
KubeClient kubernetes.Interface
Namespace string
NodeName string
TaintKey string
TaintValue string
TaintEffect string
KubeClient kubernetes.Interface
Namespace string
NodeName string
}
// NewTestingFramework returns a new instance of the testing framework.
func NewTestingFramework(kubeconfig, namespace, nodeName, taintKey, taintValue, taintEffect string) *Framework {
func NewTestingFramework(kubeconfig, namespace, nodeName string) *Framework {
return &Framework{
KubeClient: createKubeClient(kubeconfig),
Namespace: namespace,
NodeName: nodeName,
TaintKey: taintKey,
TaintValue: taintValue,
TaintEffect: taintEffect,
KubeClient: createKubeClient(kubeconfig),
Namespace: namespace,
NodeName: nodeName,
}
}

View File

@@ -15,10 +15,7 @@ import (
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
)
const (
defaultWatchTimeout = 2 * time.Minute
hostnameNodeSelectorLabel = "kubernetes.io/hostname"
)
const defaultWatchTimeout = 2 * time.Minute
// CreateDummyPodObjectWithPrefix creates a dujmmy pod object using the specified prefix as the value of .metadata.generateName.
// A variable number of strings can be provided.
@@ -33,16 +30,7 @@ func (f *Framework) CreateDummyPodObjectWithPrefix(prefix string, images ...stri
Namespace: f.Namespace,
},
Spec: corev1.PodSpec{
NodeSelector: map[string]string{
hostnameNodeSelectorLabel: f.NodeName,
},
Tolerations: []corev1.Toleration{
{
Key: f.TaintKey,
Value: f.TaintValue,
Effect: corev1.TaintEffect(f.TaintEffect),
},
},
NodeName: f.NodeName,
EnableServiceLinks: &enableServiceLink,
},
}