@@ -106,14 +106,6 @@ func (args S3FSArgs) Validate(targetPath string) error {
106
106
return fmt .Errorf ("invalid value for 'curldbg' param. Should be either 'body' or 'normal': %v" , args .CurlDebug )
107
107
}
108
108
109
- if ! (strings .HasPrefix (args .EndPoint , "https://" ) || strings .HasPrefix (args .EndPoint , "http://" )) {
110
- logger .Error ("bad value for endpoint: scheme is missing." +
111
- " Must be of the form http://<hostname> or https://<hostname>" ,
112
- zap .String ("endpoint" , args .EndPoint ))
113
- return fmt .Errorf ("bad value for endpoint \" %v\" : scheme is missing." +
114
- " Must be of the form http://<hostname> or https://<hostname>" , args .EndPoint )
115
- }
116
-
117
109
// Check if value of gid parameter can be converted to integer
118
110
if args .GID != "" {
119
111
_ , err := strconv .Atoi (args .GID )
@@ -205,11 +197,11 @@ func (args S3FSArgs) Validate(targetPath string) error {
205
197
206
198
// Check if .passwd file exists or not
207
199
if exists , err := fileExists (args .PasswdFilePath ); err != nil {
208
- logger .Error ("error checking file existence" , zap .Error (err ), zap . Any ( "path" , args . PasswdFilePath ))
209
- return fmt .Errorf ("error checking file existence: %v" , err )
200
+ logger .Error ("error checking credential file existence" , zap .Error (err ))
201
+ return fmt .Errorf ("error checking credential file existence: %v" , err )
210
202
} else if ! exists {
211
- logger .Error ("file not found" , zap . Error ( err ), zap . Any ( "path" , args . PasswdFilePath ) )
212
- return fmt .Errorf ("file not found: %v" , args . PasswdFilePath )
203
+ logger .Error ("credential file not found" )
204
+ return fmt .Errorf ("credential file not found" )
213
205
}
214
206
215
207
// Check if value of ro parameter is boolean "true" or "false"
@@ -295,5 +287,13 @@ func (args S3FSArgs) Validate(targetPath string) error {
295
287
}
296
288
}
297
289
290
+ if ! (strings .HasPrefix (args .URL , "https://" ) || strings .HasPrefix (args .URL , "http://" )) {
291
+ logger .Error ("bad value for url: scheme is missing." +
292
+ " Must be of the form http://<hostname> or https://<hostname>" ,
293
+ zap .String ("url" , args .URL ))
294
+ return fmt .Errorf ("bad value for url \" %v\" : scheme is missing." +
295
+ " Must be of the form http://<hostname> or https://<hostname>" , args .URL )
296
+ }
297
+
298
298
return nil
299
299
}
0 commit comments