File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ func configureS3(s3Config *S3Config) *s3.S3 {
203203 }
204204
205205 sess , err := session .NewSession (& aws.Config {
206+ S3ForcePathStyle : aws .Bool (true ),
206207 Region : aws .String (s3Config .Region ),
207208 Credentials : credentials .NewStaticCredentials (s3Config .AccessKey , s3Config .SecretKey , "" ),
208209 Endpoint : aws .String (s3Config .Endpoint ),
@@ -217,11 +218,17 @@ func configureS3(s3Config *S3Config) *s3.S3 {
217218
218219// Test the S3 connection by making a simple ListBuckets request
219220func testS3Connection (s3Svc * s3.S3 ) bool {
220- _ , err := s3Svc .ListBuckets (& s3.ListBucketsInput {})
221+ result , err := s3Svc .ListBuckets (& s3.ListBucketsInput {})
221222 if err != nil {
222223 log .Printf ("Failed to connect to S3: %v" , err )
223224 return false
224225 }
226+
227+ log .Println ("Successfully connected to S3. Buckets:" )
228+ for _ , bucket := range result .Buckets {
229+ log .Printf (" Present Buckets %s" , aws .StringValue (bucket .Name ))
230+ }
231+
225232 return true
226233}
227234// Example upload function (not used in connection test)
You can’t perform that action at this time.
0 commit comments