mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Invalidate CheckVolumeBinding predicate cache on PV update.
This commit is contained in:
parent
bababe08f6
commit
b841b15e27
@ -404,6 +404,11 @@ func (c *configFactory) onPvUpdate(old, new interface{}) {
|
||||
|
||||
func (c *configFactory) invalidatePredicatesForPvUpdate(oldPV, newPV *v1.PersistentVolume) {
|
||||
invalidPredicates := sets.NewString()
|
||||
// CheckVolumeBinding predicate calls SchedulerVolumeBinder.FindPodVolumes
|
||||
// which will cache PVs in PodBindingCache. When PV got updated, we should
|
||||
// invalidate cache, otherwise PVAssumeCache.Assume will fail with out of sync
|
||||
// error.
|
||||
invalidPredicates.Insert(predicates.CheckVolumeBindingPred)
|
||||
for k, v := range newPV.Labels {
|
||||
// If PV update modifies the zone/region labels.
|
||||
if isZoneRegionLabel(k) && !reflect.DeepEqual(v, oldPV.Labels[k]) {
|
||||
|
Loading…
Reference in New Issue
Block a user