Update to version 1.1.0

This commit is contained in:
chihyuwu
2022-04-25 11:10:19 +00:00
parent f0066b40ca
commit ebe7c1d97c
32 changed files with 2197 additions and 445 deletions

View File

@@ -2,6 +2,10 @@
package models
import (
"fmt"
)
const (
K8sCsiName = "Kubernetes CSI"
@@ -15,8 +19,30 @@ const (
LunTypeBlunThick = "BLUN_THICK" // thick provision, mapped to type 259
MaxIqnLen = 128
// Share definitions
MaxShareLen = 32
MaxShareDescLen = 64
UserGroupTypeLocalUser = "local_user"
UserGroupTypeLocalGroup = "local_group"
UserGroupTypeSystem = "system"
// CSI definitions
TargetPrefix = "k8s-csi"
LunPrefix = "k8s-csi"
IqnPrefix = "iqn.2000-01.com.synology:"
)
TargetPrefix = "k8s-csi"
LunPrefix = "k8s-csi"
IqnPrefix = "iqn.2000-01.com.synology:"
SharePrefix = "k8s-csi"
ShareSnapshotDescPrefix = "(Do not change)"
)
func GenLunName(volName string) string {
return fmt.Sprintf("%s-%s", LunPrefix, volName)
}
func GenShareName(volName string) string {
shareName := fmt.Sprintf("%s-%s", SharePrefix, volName)
if len(shareName) > MaxShareLen {
return shareName[:MaxShareLen]
}
return shareName
}