Przeglądaj źródła

Merge pull request #711 from scottkarnold/develop

Support spec.capacity.store in InstanceIDField for CSV Provider
Michael Dresser 5 lat temu
rodzic
commit
4d1493ee24
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      pkg/cloud/csvprovider.go

+ 8 - 0
pkg/cloud/csvprovider.go

@@ -278,6 +278,14 @@ func PVValueFromMapField(m string, n *v1.PersistentVolume) string {
 			klog.V(4).Infof("[ERROR] Unsupported InstanceIDField %s in CSV For PV", m)
 			klog.V(4).Infof("[ERROR] Unsupported InstanceIDField %s in CSV For PV", m)
 			return ""
 			return ""
 		}
 		}
+	} else if len(mf) > 2 && mf[0] == "spec" {
+		if mf[1] == "capacity" && mf[2] == "storage" {
+			skey := n.Spec.Capacity["storage"]
+			return skey.String()
+		} else {
+			klog.V(4).Infof("[ERROR] Unsupported InstanceIDField %s in CSV For PV", m)
+			return ""
+		}
 	} else {
 	} else {
 		klog.V(4).Infof("[ERROR] Unsupported InstanceIDField %s in CSV For PV", m)
 		klog.V(4).Infof("[ERROR] Unsupported InstanceIDField %s in CSV For PV", m)
 		return ""
 		return ""