aboutsummaryrefslogtreecommitdiff
path: root/pkg/driver/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/driver/utils.go')
-rw-r--r--pkg/driver/utils.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/driver/utils.go b/pkg/driver/utils.go
index b629543..e103079 100644
--- a/pkg/driver/utils.go
+++ b/pkg/driver/utils.go
@@ -8,6 +8,7 @@ import (
"sync"
"github.com/container-storage-interface/spec/lib/go/csi"
+ "github.com/seaweedfs/seaweedfs-csi-driver/pkg/datalocality"
"github.com/seaweedfs/seaweedfs/weed/glog"
"golang.org/x/net/context"
"google.golang.org/grpc"
@@ -121,3 +122,10 @@ func (km *KeyMutex) GetMutex(key string) *sync.Mutex {
func (km *KeyMutex) RemoveMutex(key string) {
km.mutexes.Delete(key)
}
+
+func CheckDataLocality(dataLocality *datalocality.DataLocality, dataCenter *string) error {
+ if(*dataLocality != datalocality.None && *dataCenter == ""){
+ return fmt.Errorf("dataLocality set, but not all locality-definitions were set")
+ }
+ return nil
+}