Skip to content

Commit 77d849d

Browse files
author
houz
authored
Merge pull request #9 from killwing/dev-v1.9.7
add travis go test
2 parents 118ea2c + 0f19186 commit 77d849d

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ go:
33
- "1.11"
44
install:
55
- mv $GOPATH/src/github.com/qiniu-ava $GOPATH/src/github.com/Microsoft
6+
script:
7+
- make
8+
- go test ./...
9+

kube-scheduler/pkg/algorithm/predicates/predicates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ func (c *VolumeZoneChecker) predicate(pod *v1.Pod, meta algorithm.PredicateMetad
513513
class, _ := c.classInfo.GetStorageClassInfo(*scName)
514514
if class != nil {
515515
if class.VolumeBindingMode == nil {
516-
return false, nil, fmt.Errorf("VolumeBindingMode not set for StorageClass %q", scName)
516+
return false, nil, fmt.Errorf("VolumeBindingMode not set for StorageClass %q", *scName)
517517
}
518518
if *class.VolumeBindingMode == storagev1.VolumeBindingWaitForFirstConsumer {
519519
// Skip unbound volumes

kube-scheduler/pkg/scheduler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ func (sched *Scheduler) bindVolumesWorker() {
331331
// The Pod is always sent back to the scheduler afterwards.
332332
err := sched.config.VolumeBinder.Binder.BindPodVolumes(assumed)
333333
if err != nil {
334-
glog.V(1).Infof("Failed to bind volumes for pod \"%v/%v\"", assumed.Namespace, assumed.Name, err)
334+
glog.V(1).Infof("Failed to bind volumes for pod \"%v/%v: %s\"", assumed.Namespace, assumed.Name, err)
335335
reason = "VolumeBindingFailed"
336336
eventType = v1.EventTypeWarning
337337
} else {

kubeinterface/kubeinterface_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func comparePod(pod0 *types.PodInfo, pod1 *types.PodInfo) {
6262
if pod0.NodeName != pod1.NodeName {
6363
fmt.Printf("Nodename does not match %s %s\n", pod0.NodeName, pod1.NodeName)
6464
}
65+
6566
compareContainers(pod0.InitContainers, pod1.InitContainers)
6667
compareContainers(pod0.RunningContainers, pod1.RunningContainers)
6768
}
@@ -124,7 +125,7 @@ func TestConvert(t *testing.T) {
124125
ObjectMeta: metav1.ObjectMeta{
125126
Name: "Pod0",
126127
Annotations: map[string]string{
127-
"ABCD": "EFGH",
128+
"ABCD": "EFGH",
128129
"pod.alpha/DeviceInformation": string(jsonStr),
129130
// "PodInfo/InitContainer/Init0/Requests/alpha/grpresource/gpu/0/cards": "1",
130131
// "PodInfo/InitContainer/Init0/Requests/alpha/grpresource/gpu/0/memory": "100000",
@@ -174,6 +175,7 @@ func TestConvert(t *testing.T) {
174175
expectedPodInfo := &types.PodInfo{
175176
Name: "Pod0",
176177
NodeName: "",
178+
Requests: types.ResourceList{},
177179
InitContainers: map[string]types.ContainerInfo{
178180
"Init0": {
179181
KubeRequests: types.ResourceList{"CPU": 4, "Memory": 100000, "Other": 20},
@@ -234,7 +236,7 @@ func TestConvert(t *testing.T) {
234236

235237
jsonStr, _ = json.Marshal(podInfo)
236238
expectedAnnotations := map[string]string{
237-
"ABCD": "EFGH", // existing
239+
"ABCD": "EFGH", // existing
238240
"pod.alpha/DeviceInformation": string(jsonStr),
239241
// "PodInfo/InitContainer/Init0/Requests/alpha/grpresource/gpu/0/cards": "1",
240242
// "PodInfo/InitContainer/Init0/Requests/alpha/grpresource/gpu/0/memory": "100000",

0 commit comments

Comments
 (0)