mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Improving error messages and naming to be clear
This commit is contained in:
parent
07bc06ba50
commit
20ce8b71ab
@ -28,6 +28,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/client/cache"
|
"k8s.io/kubernetes/pkg/client/cache"
|
||||||
qosutil "k8s.io/kubernetes/pkg/kubelet/qos/util"
|
qosutil "k8s.io/kubernetes/pkg/kubelet/qos/util"
|
||||||
"k8s.io/kubernetes/pkg/labels"
|
"k8s.io/kubernetes/pkg/labels"
|
||||||
|
utilruntime "k8s.io/kubernetes/pkg/util/runtime"
|
||||||
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithm"
|
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithm"
|
||||||
priorityutil "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/priorities/util"
|
priorityutil "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/priorities/util"
|
||||||
"k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache"
|
"k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache"
|
||||||
@ -161,7 +162,7 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []api.Volume, namespace
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
// if the PVC is not found, log the error and count the PV towards the PV limit
|
// 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
|
// 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())
|
source := rand.NewSource(time.Now().UnixNano())
|
||||||
generatedID := "missingPVC" + strconv.Itoa(rand.New(source).Intn(1000000))
|
generatedID := "missingPVC" + strconv.Itoa(rand.New(source).Intn(1000000))
|
||||||
filteredVolumes[generatedID] = true
|
filteredVolumes[generatedID] = true
|
||||||
@ -178,7 +179,7 @@ func (c *MaxPDVolumeCountChecker) filterVolumes(volumes []api.Volume, namespace
|
|||||||
// if the PV is not found, log the error
|
// if the PV is not found, log the error
|
||||||
// and count the PV towards the PV limit
|
// and count the PV towards the PV limit
|
||||||
// generate a random volume ID since its required for de-dup
|
// 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())
|
source := rand.NewSource(time.Now().UnixNano())
|
||||||
generatedID := "missingPV" + strconv.Itoa(rand.New(source).Intn(1000000))
|
generatedID := "missingPV" + strconv.Itoa(rand.New(source).Intn(1000000))
|
||||||
filteredVolumes[generatedID] = true
|
filteredVolumes[generatedID] = true
|
||||||
|
@ -1411,7 +1411,7 @@ func TestEBSVolumeCountConflicts(t *testing.T) {
|
|||||||
{
|
{
|
||||||
VolumeSource: api.VolumeSource{
|
VolumeSource: api.VolumeSource{
|
||||||
PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{
|
PersistentVolumeClaim: &api.PersistentVolumeClaimVolumeSource{
|
||||||
ClaimName: "deletedPV",
|
ClaimName: "pvcWithDeletedPV",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1549,8 +1549,8 @@ func TestEBSVolumeCountConflicts(t *testing.T) {
|
|||||||
Spec: api.PersistentVolumeClaimSpec{VolumeName: "someNonEBSVol"},
|
Spec: api.PersistentVolumeClaimSpec{VolumeName: "someNonEBSVol"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ObjectMeta: api.ObjectMeta{Name: "deletedPV"},
|
ObjectMeta: api.ObjectMeta{Name: "pvcWithDeletedPV"},
|
||||||
Spec: api.PersistentVolumeClaimSpec{VolumeName: "deletedPV"},
|
Spec: api.PersistentVolumeClaimSpec{VolumeName: "pvcWithDeletedPV"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user