@@ -11,6 +11,8 @@ import (
11
11
12
12
csi "github.com/container-storage-interface/spec/lib/go/csi"
13
13
fsnotify "github.com/fsnotify/fsnotify"
14
+ "google.golang.org/grpc/codes"
15
+ "google.golang.org/grpc/status"
14
16
v1 "k8s.io/api/core/v1"
15
17
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
16
18
"k8s.io/apimachinery/pkg/util/wait"
@@ -165,7 +167,7 @@ func setupCaching(devicePath string, req *csi.NodeStageVolumeRequest, nodeId str
165
167
}
166
168
err , isCached := isCachingSetup (mainLvName )
167
169
if err != nil {
168
- klog .Errorf ("faild to check if caching ius setup for LV, continuing to setup caching." )
170
+ klog .Errorf ("failed to check if caching is setup for LV, continuing to setup caching." )
169
171
}
170
172
cacheLvName := getLvName (cacheSuffix , volumeId )
171
173
if isCached {
@@ -194,6 +196,9 @@ func setupCaching(devicePath string, req *csi.NodeStageVolumeRequest, nodeId str
194
196
}
195
197
info , err = common .RunCommand ("" /* pipedCmd */ , nil /* pipedCmdArg */ , "lvcreate" , args ... )
196
198
if err != nil {
199
+ if strings .Contains (err .Error (), "insufficient free space" ) {
200
+ return mainDevicePath , status .Error (codes .InvalidArgument , fmt .Sprintf ("Error setting up cache: %v" , err .Error ()))
201
+ }
197
202
return mainDevicePath , fmt .Errorf ("Errored while creating cache %w: %s" , err , info )
198
203
}
199
204
}
@@ -391,6 +396,7 @@ func checkVgExists(volumeGroupName string) bool {
391
396
return false
392
397
}
393
398
// Check if the required volume group already exists
399
+ klog .Infof ("check vg exists output: %v, volumeGroupName: %v" , string (info ), volumeGroupName )
394
400
return strings .Contains (string (info ), volumeGroupName )
395
401
}
396
402
0 commit comments