aboutsummaryrefslogtreecommitdiff
path: root/pkg/driver/utils.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2023-01-17 06:20:55 -0800
committerGitHub <noreply@github.com>2023-01-17 06:20:55 -0800
commit9e412bac1bfad86fa49749233d0775b4229dd88e (patch)
tree292e548684f701481be3e5389c87417e5e7d2b34 /pkg/driver/utils.go
parentf4d651da6c3f05cd4da6f021d3b5f4e26c2367f9 (diff)
parent0aac9a8a0309851d0195bf670da2489dd760972a (diff)
downloadseaweedfs-csi-driver-9e412bac1bfad86fa49749233d0775b4229dd88e.tar.xz
seaweedfs-csi-driver-9e412bac1bfad86fa49749233d0775b4229dd88e.zip
Merge pull request #102 from Ruakij/feat_dataLocality
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
+}