sched: adjust events to register for VolumeBinding plugin

This commit is contained in:
Wei Huang
2021-10-05 16:46:59 -07:00
parent b0eac84937
commit b7d90ca991
3 changed files with 23 additions and 9 deletions

View File

@@ -285,6 +285,17 @@ func (p *PodWrapper) HostPort(port int32) *PodWrapper {
return p
}
// PVC creates a Volume with a PVC and injects into the inner pod.
func (p *PodWrapper) PVC(name string) *PodWrapper {
p.Spec.Volumes = append(p.Spec.Volumes, v1.Volume{
Name: name,
VolumeSource: v1.VolumeSource{
PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ClaimName: name},
},
})
return p
}
// PodAffinityKind represents different kinds of PodAffinity.
type PodAffinityKind int