|
|
@@ -658,7 +658,7 @@ func TestGenerateSlimK8sNodeFromV1Node(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
func TestGenerateSlimK8sDiskFromV1PV(t *testing.T) {
|
|
|
- testv1PV := &v1.PersistentVolume{}
|
|
|
+ testv1PV := &clustercache.PersistentVolume{}
|
|
|
testv1PV.Spec.Capacity = v1.ResourceList{
|
|
|
v1.ResourceStorage: *resource.NewQuantity(16*1024*1024*1024, resource.BinarySI),
|
|
|
}
|
|
|
@@ -672,7 +672,7 @@ func TestGenerateSlimK8sDiskFromV1PV(t *testing.T) {
|
|
|
testv1PV.Spec.StorageClassName = "testStorageClass"
|
|
|
cases := []struct {
|
|
|
name string
|
|
|
- testPV *v1.PersistentVolume
|
|
|
+ testPV *clustercache.PersistentVolume
|
|
|
expectedSlimDisk *SlimK8sDisk
|
|
|
inpRegionID string
|
|
|
}{
|
|
|
@@ -773,7 +773,7 @@ func TestDeterminePVRegion(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
// testPV1 contains the Label with region information as well as node affinity in spec
|
|
|
- testPV1 := &v1.PersistentVolume{}
|
|
|
+ testPV1 := &clustercache.PersistentVolume{}
|
|
|
testPV1.Name = "testPV1"
|
|
|
testPV1.Labels = make(map[string]string)
|
|
|
testPV1.Labels[ALIBABA_DISK_TOPOLOGY_REGION_LABEL] = "us-east-1"
|
|
|
@@ -784,13 +784,13 @@ func TestDeterminePVRegion(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
// testPV2 contains the only zone label
|
|
|
- testPV2 := &v1.PersistentVolume{}
|
|
|
+ testPV2 := &clustercache.PersistentVolume{}
|
|
|
testPV2.Name = "testPV2"
|
|
|
testPV2.Labels = make(map[string]string)
|
|
|
testPV2.Labels[ALIBABA_DISK_TOPOLOGY_ZONE_LABEL] = "us-east-1a"
|
|
|
|
|
|
// testPV3 contains only node affinity in spec
|
|
|
- testPV3 := &v1.PersistentVolume{}
|
|
|
+ testPV3 := &clustercache.PersistentVolume{}
|
|
|
testPV3.Name = "testPV3"
|
|
|
testPV3.Spec.NodeAffinity = &v1.VolumeNodeAffinity{
|
|
|
Required: &v1.NodeSelector{
|
|
|
@@ -799,12 +799,12 @@ func TestDeterminePVRegion(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
// testPV4 contains no label/annotation or any node affinity
|
|
|
- testPV4 := &v1.PersistentVolume{}
|
|
|
+ testPV4 := &clustercache.PersistentVolume{}
|
|
|
testPV4.Name = "testPV4"
|
|
|
|
|
|
cases := []struct {
|
|
|
name string
|
|
|
- inputPV *v1.PersistentVolume
|
|
|
+ inputPV *clustercache.PersistentVolume
|
|
|
expectedRegion string
|
|
|
}{
|
|
|
{
|