Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for MergeTolerations (0.74 sec)

  1. pkg/util/tolerations/tolerations.go

    		for _, w := range whitelist {
    			if isSuperset(w, t) {
    				continue next
    			}
    		}
    		return false
    	}
    
    	return true
    }
    
    // MergeTolerations merges two sets of tolerations into one. If one toleration is a superset of
    // another, only the superset is kept.
    func MergeTolerations(first, second []api.Toleration) []api.Toleration {
    	all := append(first, second...)
    	var merged []api.Toleration
    
    next:
    	for i, t := range all {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 16 11:54:27 UTC 2020
    - 2.7K bytes
    - Viewed (0)
  2. pkg/util/tolerations/tolerations_test.go

    						break
    					}
    				}
    				require.True(t, uncontained, debugMsg(input, whitelist))
    			}
    		}
    	})
    
    	t.Run("MergeTolerations", func(t *testing.T) {
    		for i := 0; i < iterations; i++ {
    			a := genTolerations()
    			b := genTolerations()
    			result := MergeTolerations(a, b)
    			for _, tol := range append(a, b...) {
    				require.True(t, isContained(tol, result), debugMsg(a, b, result))
    			}
    		}
    	})
    }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Aug 26 22:25:49 UTC 2019
    - 11.4K bytes
    - Viewed (0)
  3. plugin/pkg/admission/podtolerationrestriction/admission.go

    			Operator: api.TolerationOpExists,
    			Effect:   api.TaintEffectNoSchedule,
    		})
    	}
    	// Final merge of tolerations irrespective of pod type.
    	if len(extraTolerations) > 0 {
    		pod.Spec.Tolerations = tolerations.MergeTolerations(pod.Spec.Tolerations, extraTolerations)
    	}
    	return p.Validate(ctx, a, o)
    }
    
    // Validate we can obtain a whitelist of tolerations
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jun 29 20:07:59 UTC 2020
    - 8.3K bytes
    - Viewed (0)
  4. plugin/pkg/admission/runtimeclass/admission.go

    			}
    			newNodeSelector[key] = runtimeClassValue
    		}
    	}
    
    	newTolerations := tolerations.MergeTolerations(pod.Spec.Tolerations, nodeScheduling.Tolerations)
    
    	pod.Spec.NodeSelector = newNodeSelector
    	pod.Spec.Tolerations = newTolerations
    
    	return nil
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 05 05:53:38 UTC 2024
    - 8.9K bytes
    - Viewed (0)
Back to top