45 lines
1.5 KiB
Diff
45 lines
1.5 KiB
Diff
diff --git a/src/lib/datasource/S3.ts b/src/lib/datasource/S3.ts
|
|
index 089dd64..39dd8f4 100644
|
|
--- a/src/lib/datasource/S3.ts
|
|
+++ b/src/lib/datasource/S3.ts
|
|
@@ -4,7 +4,6 @@ import {
|
|
DeleteObjectCommand,
|
|
DeleteObjectsCommand,
|
|
GetObjectCommand,
|
|
- ListBucketsCommand,
|
|
ListObjectsCommand,
|
|
PutObjectCommand,
|
|
S3Client,
|
|
@@ -38,32 +37,6 @@ export class S3Datasource extends Datasource {
|
|
endpoint: this.options.endpoint ?? undefined,
|
|
forcePathStyle: this.options.forcePathStyle ?? false,
|
|
});
|
|
-
|
|
- this.ensureBucketExists();
|
|
- }
|
|
-
|
|
- private async ensureBucketExists() {
|
|
- try {
|
|
- const res = await this.client.send(new ListBucketsCommand());
|
|
- if (res.$metadata.httpStatusCode !== 200) {
|
|
- this.logger
|
|
- .error('there was an error while listing buckets', res.$metadata as Record<string, unknown>)
|
|
- .error('zipline will now exit');
|
|
- process.exit(1);
|
|
- }
|
|
-
|
|
- if (!res.Buckets?.find((bucket) => bucket.Name === this.options.bucket)) {
|
|
- this.logger.error(`bucket ${this.options.bucket} does not exist`).error('zipline will now exit');
|
|
- process.exit(1);
|
|
- }
|
|
- } catch (e) {
|
|
- this.logger
|
|
- .error('there was an error while listing buckets', e as Record<string, unknown>)
|
|
- .error('zipline will now exit');
|
|
- process.exit(1);
|
|
- } finally {
|
|
- this.logger.debug(`bucket ${this.options.bucket} exists`);
|
|
- }
|
|
}
|
|
|
|
public async get(file: string): Promise<Readable | null> {
|