@@ -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"
@@ -159,13 +161,16 @@ func setupCaching(devicePath string, req *csi.NodeStageVolumeRequest, nodeId str
159
161
}
160
162
info , err = common .RunCommand ("" /* pipedCmd */ , nil /* pipedCmdArg */ , "lvcreate" , args ... )
161
163
if err != nil {
164
+ if strings .Contains (err .Error (), "insufficient free space" ) {
165
+ return mainDevicePath , status .Error (codes .InvalidArgument , fmt .Sprintf ("Error setting up cache: %v" , err .Error ()))
166
+ }
162
167
return mainDevicePath , fmt .Errorf ("Errored setting up logical volume for the volume %s %w: %s" , devicePath , err , info )
163
168
}
164
169
165
170
}
166
171
err , isCached := isCachingSetup (mainLvName )
167
172
if err != nil {
168
- klog .Errorf ("faild to check if caching ius setup for LV, continuing to setup caching." )
173
+ klog .Errorf ("failed to check if caching is setup for LV, continuing to setup caching." )
169
174
}
170
175
cacheLvName := getLvName (cacheSuffix , volumeId )
171
176
if isCached {
0 commit comments