Commit 20ce8b71 authored by Abhishek Gupta's avatar Abhishek Gupta

Improving error messages and naming to be clear

parent 07bc06ba
......@@ -28,6 +28,7 @@ import (
"k8s.io/kubernetes/pkg/client/cache"
qosutil "k8s.io/kubernetes/pkg/kubelet/qos/util"
"k8s.io/kubernetes/pkg/labels"
utilruntime "k8s.io/kubernetes/pkg/util/runtime"
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithm"
priorityutil "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/priorities/util"
"k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache"
......@@ -161,7 +162,7 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []api.Volume, namespace
if err != nil {
// if the PVC is not found, log the error and count the PV towards the PV limit
// generate a random volume ID since its required for de-dup
glog.Error(err)
utilruntime.HandleError(fmt.Errorf("Unable to look up PVC info for %s/%s, assuming PVC matches predicate when counting limits: %v", namespace, pvcName, err))
source := rand.NewSource(time.Now().UnixNano())
generatedID := "missingPVC" + strconv.Itoa(rand.New(source).Intn(1000000))
filteredVolumes[generatedID] = true
......@@ -178,7 +179,7 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []api.Volume, namespace
// if the PV is not found, log the error
// and count the PV towards the PV limit
// generate a random volume ID since its required for de-dup
glog.Error(err)
utilruntime.HandleError(fmt.Errorf("Unable to look up PV info for %s/%s/%s, assuming PV matches predicate when counting limits: %v", namespace, pvcName, pvName, err))
source := rand.NewSource(time.Now().UnixNano())
generatedID := "missingPV" + strconv.Itoa(rand.New(source).Intn(1000000))
filteredVolumes[generatedID] = true
......
......@@ -1411,7 +1411,7 @@ func TestEBSVolumeCountConflicts(t *testing.T) {
{
VolumeSource: api.VolumeSource{
PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{
ClaimName: "deletedPV",
ClaimName: "pvcWithDeletedPV",
},
},
},
......@@ -1549,8 +1549,8 @@ func TestEBSVolumeCountConflicts(t *testing.T) {
Spec: api.PersistentVolumeClaimSpec{VolumeName: "someNonEBSVol"},
},
{
ObjectMeta: api.ObjectMeta{Name: "deletedPV"},
Spec: api.PersistentVolumeClaimSpec{VolumeName: "deletedPV"},
ObjectMeta: api.ObjectMeta{Name: "pvcWithDeletedPV"},
Spec: api.PersistentVolumeClaimSpec{VolumeName: "pvcWithDeletedPV"},
},
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment