Skip to content

Commit

Permalink
:fix: Destination S3: connector check ignores the s3_bucket_path (air…
Browse files Browse the repository at this point in the history
…bytehq#15207)

* fix: use correct var for s3 bucket path

* typo

* fix - use bucket path instead of bucket name

* fix: use correct var for s3 bucket path

* typo

* fix - use bucket path instead of bucket name

* add fix to changelog

* solve conflict

* solve conflict

* fix - use bucket path instead of bucket name

* solve md file conflict

* solve dockerfile conflict

* auto-bump connector version [ci skip]

* add eof

Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com>
Co-authored-by: marcosmarxm <marcosmarxm@gmail.com>
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
  • Loading branch information
4 people authored Aug 24, 2022
1 parent db4842d commit 7834eef
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
- name: S3
destinationDefinitionId: 4816b78f-1489-44c1-9060-4b19d5fa9362
dockerRepository: airbyte/destination-s3
dockerImageTag: 0.3.13
dockerImageTag: 0.3.14
documentationUrl: https://docs.airbyte.io/integrations/destinations/s3
icon: s3.svg
resourceRequirements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4118,7 +4118,7 @@
supported_destination_sync_modes:
- "append"
- "overwrite"
- dockerImage: "airbyte/destination-s3:0.3.13"
- dockerImage: "airbyte/destination-s3:0.3.14"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/destinations/s3"
connectionSpecification:
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/destination-s3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ RUN /bin/bash -c 'set -e && \
echo "unknown arch" ;\
fi'

LABEL io.airbyte.version=0.3.13
LABEL io.airbyte.version=0.3.14
LABEL io.airbyte.name=airbyte/destination-s3
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public AirbyteConnectionStatus check(final JsonNode config) {
final S3StorageOperations storageOperations = new S3StorageOperations(nameTransformer, s3Client, destinationConfig);

// Test for writing, list and delete
S3Destination.attemptS3WriteAndDelete(storageOperations, destinationConfig, destinationConfig.getBucketName());
S3Destination.attemptS3WriteAndDelete(storageOperations, destinationConfig, destinationConfig.getBucketPath());

// Test single upload (for small files) permissions
testSingleUpload(s3Client, destinationConfig.getBucketName(), destinationConfig.getBucketPath());
Expand Down Expand Up @@ -136,16 +136,17 @@ static void attemptS3WriteAndDelete(final S3StorageOperations storageOperations,
final AmazonS3 s3) {
final var prefix = bucketPath.isEmpty() ? "" : bucketPath + (bucketPath.endsWith("/") ? "" : "/");
final String outputTableName = prefix + "_airbyte_connection_test_" + UUID.randomUUID().toString().replaceAll("-", "");
attemptWriteAndDeleteS3Object(storageOperations, s3Config, outputTableName, s3);
attemptWriteAndDeleteS3Object(storageOperations, s3Config, outputTableName, s3, bucketPath);
}

private static void attemptWriteAndDeleteS3Object(final S3StorageOperations storageOperations,
final S3DestinationConfig s3Config,
final String outputTableName,
final AmazonS3 s3) {
final AmazonS3 s3,
final String bucketPath) {
final var s3Bucket = s3Config.getBucketName();

storageOperations.createBucketObjectIfNotExists(s3Bucket);
storageOperations.createBucketObjectIfNotExists(bucketPath);
s3.putObject(s3Bucket, outputTableName, "check-content");
testIAMUserHasListObjectPermission(s3, s3Bucket);
s3.deleteObject(s3Bucket, outputTableName);
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/destinations/s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ In order for everything to work correctly, it is also necessary that the user wh

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:-----------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------|
| 0.3.14 | 2022-08-24 | [\#15207](https://github.com/airbytehq/airbyte/pull/15207) | Fix S3 bucket path to be used for check. |
| 0.3.13 | 2022-08-09 | [\#15394](https://github.com/airbytehq/airbyte/pull/15394) | Added LZO compression support to Parquet format |
| 0.3.12 | 2022-08-05 | [\#14801](https://github.com/airbytehq/airbyte/pull/14801) | Fix multiple log bindings |
| 0.3.11 | 2022-07-15 | [\#14494](https://github.com/airbytehq/airbyte/pull/14494) | Make S3 output filename configurable. |
Expand Down

0 comments on commit 7834eef

Please sign in to comment.