Explorar el Código

Support spec.capacity.store in InstanceIDField for CSV Provider

scott.arnold hace 5 años
padre
commit
67e0a69fb6
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  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)
 			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 {
 		klog.V(4).Infof("[ERROR] Unsupported InstanceIDField %s in CSV For PV", m)
 		return ""