Apply davidopps comments to TaintController PR

This commit is contained in:
gmarek
2017-02-13 11:48:34 +01:00
parent 65cfd86c89
commit de6c9bd535
13 changed files with 376 additions and 109 deletions

View File

@@ -403,6 +403,9 @@ func DeleteTaint(taints []Taint, taintToDelete *Taint) ([]Taint, bool) {
// Returns true and list of Tolerations matching all Taints if all are tolerated, or false otherwise.
func GetMatchingTolerations(taints []Taint, tolerations []Toleration) (bool, []Toleration) {
if len(taints) == 0 {
return true, []Toleration{}
}
if len(tolerations) == 0 && len(taints) > 0 {
return false, []Toleration{}
}