mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
* Modifies storage according to the new workflow Adds test Signed-off-by: mik-dass <mrinald7@gmail.com> * Added e2e tests Signed-off-by: mik-dass <mrinald7@gmail.com> * Added comments for CreateArgs and DeleteFromConfigurationList * Rebased the PR Signed-off-by: mik-dass <mrinald7@gmail.com> * Mereged storage e2e test with watch test
30 lines
622 B
Go
30 lines
622 B
Go
package testingutil
|
|
|
|
import (
|
|
"k8s.io/apimachinery/pkg/api/resource"
|
|
|
|
corev1 "k8s.io/api/core/v1"
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
)
|
|
|
|
func FakePVC(pvcName, size string, labels map[string]string) *corev1.PersistentVolumeClaim {
|
|
quantity, err := resource.ParseQuantity(size)
|
|
if err != nil {
|
|
return nil
|
|
}
|
|
|
|
return &corev1.PersistentVolumeClaim{
|
|
ObjectMeta: metav1.ObjectMeta{
|
|
Name: pvcName,
|
|
Labels: labels,
|
|
},
|
|
Spec: corev1.PersistentVolumeClaimSpec{
|
|
Resources: corev1.ResourceRequirements{
|
|
Requests: corev1.ResourceList{
|
|
corev1.ResourceStorage: quantity,
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|