mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #74568 from hex108/pv
Remove redundant checker whether pod has claims in func FindPodVolumes
This commit is contained in:
commit
8ef336c05a
@ -139,15 +139,6 @@ func (b *volumeBinder) GetBindingsCache() PodBindingCache {
|
|||||||
return b.podBindingCache
|
return b.podBindingCache
|
||||||
}
|
}
|
||||||
|
|
||||||
func podHasClaims(pod *v1.Pod) bool {
|
|
||||||
for _, vol := range pod.Spec.Volumes {
|
|
||||||
if vol.PersistentVolumeClaim != nil {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// FindPodVolumes caches the matching PVs and PVCs to provision per node in podBindingCache.
|
// FindPodVolumes caches the matching PVs and PVCs to provision per node in podBindingCache.
|
||||||
// This method intentionally takes in a *v1.Node object instead of using volumebinder.nodeInformer.
|
// This method intentionally takes in a *v1.Node object instead of using volumebinder.nodeInformer.
|
||||||
// That's necessary because some operations will need to pass in to the predicate fake node objects.
|
// That's necessary because some operations will need to pass in to the predicate fake node objects.
|
||||||
@ -168,11 +159,6 @@ func (b *volumeBinder) FindPodVolumes(pod *v1.Pod, node *v1.Node) (unboundVolume
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if !podHasClaims(pod) {
|
|
||||||
// Fast path
|
|
||||||
return unboundVolumesSatisfied, boundVolumesSatisfied, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
matchedClaims []*bindingInfo
|
matchedClaims []*bindingInfo
|
||||||
provisionedClaims []*v1.PersistentVolumeClaim
|
provisionedClaims []*v1.PersistentVolumeClaim
|
||||||
|
Loading…
Reference in New Issue
Block a user