Add no admit on node side

Update generated code

Refactored predicates & restore helper
This commit is contained in:
Harry Zhang
2016-05-27 15:57:05 +08:00
committed by Harry Zhang
parent b60df6c312
commit c735921b6f
10 changed files with 128 additions and 35 deletions

View File

@@ -29,7 +29,6 @@ var (
ErrVolumeZoneConflict = newPredicateFailureError("NoVolumeZoneConflict")
ErrNodeSelectorNotMatch = newPredicateFailureError("MatchNodeSelector")
ErrPodAffinityNotMatch = newPredicateFailureError("MatchInterPodAffinity")
ErrTaintsTolerationsNotMatch = newPredicateFailureError("PodToleratesNodeTaints")
ErrPodNotMatchHostName = newPredicateFailureError("HostName")
ErrPodNotFitsHostPorts = newPredicateFailureError("PodFitsHostPorts")
ErrNodeLabelPresenceViolated = newPredicateFailureError("CheckNodeLabelPresence")
@@ -42,6 +41,25 @@ var (
ErrFakePredicate = newPredicateFailureError("FakePredicateError")
)
// ErrTaintsTolerationsNotMatch is an error type that indicates with if it should be aware by kubelet.
type ErrTaintsTolerationsNotMatch struct {
SomeUntoleratedTaintIsNoAdmit bool
}
func newErrTaintsTolerationsNotMatch(someUntoleratedTaintIsNoAdmit bool) *ErrTaintsTolerationsNotMatch {
return &ErrTaintsTolerationsNotMatch{
SomeUntoleratedTaintIsNoAdmit: someUntoleratedTaintIsNoAdmit,
}
}
func (e *ErrTaintsTolerationsNotMatch) Error() string {
return fmt.Sprintf("Taint Toleration unmatched with SomeUntoleratedTaintIsNoAdmit is: %v", e.SomeUntoleratedTaintIsNoAdmit)
}
func (e *ErrTaintsTolerationsNotMatch) GetReason() string {
return fmt.Sprintf("ErrTaintsTolerationsNotMatch, and SomeUntoleratedTaintIsNoAdmit is: %v", e.SomeUntoleratedTaintIsNoAdmit)
}
// InsufficientResourceError is an error type that indicates what kind of resource limit is
// hit and caused the unfitting failure.
type InsufficientResourceError struct {