mirror of https://github.com/k3s-io/k3s
Used const variable in scheduler test.
parent
0ce580928a
commit
e0d02f140e
|
@ -44,7 +44,7 @@ type FitError struct {
|
|||
|
||||
var ErrNoNodesAvailable = fmt.Errorf("no nodes available to schedule pods")
|
||||
|
||||
const NoNodeAvailableMsg = "No nodes are available that match all of the following predicates:"
|
||||
const NoNodeAvailableMsg = "No nodes are available that match all of the following predicates"
|
||||
|
||||
// Error returns detailed information of why the pod failed to fit on each node
|
||||
func (f *FitError) Error() string {
|
||||
|
|
|
@ -410,7 +410,7 @@ func TestHumanReadableFitError(t *testing.T) {
|
|||
"3": []algorithm.PredicateFailureReason{algorithmpredicates.ErrNodeUnderDiskPressure},
|
||||
},
|
||||
}
|
||||
if strings.Contains(error.Error(), "No nodes are available that match all of the following predicates") {
|
||||
if strings.Contains(error.Error(), NoNodeAvailableMsg) {
|
||||
if strings.Contains(error.Error(), "NodeUnderDiskPressure (2)") && strings.Contains(error.Error(), "NodeUnderMemoryPressure (1)") {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue