@@ -106,14 +106,6 @@ func (args S3FSArgs) Validate(targetPath string) error {
106106 return fmt .Errorf ("invalid value for 'curldbg' param. Should be either 'body' or 'normal': %v" , args .CurlDebug )
107107 }
108108
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-
117109 // Check if value of gid parameter can be converted to integer
118110 if args .GID != "" {
119111 _ , err := strconv .Atoi (args .GID )
@@ -205,11 +197,11 @@ func (args S3FSArgs) Validate(targetPath string) error {
205197
206198 // Check if .passwd file exists or not
207199 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 )
210202 } 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" )
213205 }
214206
215207 // Check if value of ro parameter is boolean "true" or "false"
@@ -295,5 +287,13 @@ func (args S3FSArgs) Validate(targetPath string) error {
295287 }
296288 }
297289
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+
298298 return nil
299299}
0 commit comments