mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 11:45:20 +00:00
Add changing PVC selected node E2E test
Signed-off-by: danfengl <danfengl@vmware.com>
This commit is contained in:
@@ -255,10 +255,16 @@ func GetPVByPodName(client TestClient, namespace, podName string) (string, error
|
||||
}
|
||||
return pv_value.Name, nil
|
||||
}
|
||||
func CreatePodWithPVC(client TestClient, ns, podName, sc string, volumeNameList []string) (*corev1.Pod, error) {
|
||||
func CreatePodWithPVC(client TestClient, ns, podName, sc, pvcName string, volumeNameList []string, pvcAnn map[string]string) (*corev1.Pod, error) {
|
||||
volumes := []corev1.Volume{}
|
||||
for _, volume := range volumeNameList {
|
||||
pvc, err := CreatePVC(client, ns, fmt.Sprintf("pvc-%s", volume), sc)
|
||||
var _pvcName string
|
||||
if pvcName == "" {
|
||||
_pvcName = fmt.Sprintf("pvc-%s", volume)
|
||||
} else {
|
||||
_pvcName = pvcName
|
||||
}
|
||||
pvc, err := CreatePVC(client, ns, _pvcName, sc, pvcAnn)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user